[Bug 218850] Unexpected failure when write to a file with two file descriptor

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

 



https://bugzilla.kernel.org/show_bug.cgi?id=218850

Theodore Tso (tytso@xxxxxxx) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |tytso@xxxxxxx
         Resolution|---                         |INVALID

--- Comment #3 from Theodore Tso (tytso@xxxxxxx) ---
Hint:   check the return value of all system calls.   In particular, check to
see what the read(fd_b, buf_4, 73728) returns.    Check to see what the size of
the file is after write(fd_a, buf_15, 9900), and then reflect on what happens
if the read ends up hitting the end of file marker, and what the offset of fd_b
is after the short read when hitting EOF.

Finally, read the documentation for the O_DIRECT flag in the NOTES section of
the open man page[1], and understand what the requirements are for O_DIRECT
writes, in particular about the alignment requirements are of the starting
offset when performing an O_DIRECT write (or O_DIRECT) read.   Then also check
on the errno return (for example replace the printf("write failure\n") with
perror("write").

[1] https://man7.org/linux/man-pages/man2/open.2.html

In any case, this is not a bug, and this is not a good place for you to be
asking for instruction in basic Unix system call programming.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux