Plug pull scenario in scsi observation on kernel 2.6, what is correct behavior and why

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



kernel version(SUSE): 2.6.5-7.97.

There seems to be an abnormal write behavior when
we are writing on /dev/sdc in a loop with following user application code
----------------------------------------------------------------------------
#include <errno.h>
#include<stdio.h>
#include<unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

for ( i = 0; i<100 ; i++)
{
    ret = write(fd,buf,1000000);
    printf("%d\n", ret);
   fsync(fd);
   printf("%d\n",errno);

}
O/P on scenario-----------------------------------------
before plug pull O/P is like this for each write
1000000
0

and after plug pull O/P for remaining writes is always 
98603
5

Is this correct and why
Or
should be the behaviour
for all remaining writes be
-1
5
or
0
5

since after a plug pull no data transfer can occur.

Thanks and Regards
Deepak

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux