From: bugzilla-daemon@kernel.org
To: linux-ext4@vger.kernel.org
Subject: [Bug 218850] Unexpected failure when write to a file with two file descriptor
Date: Mon, 27 May 2024 21:14:06 +0000 [thread overview]
Message-ID: <bug-218850-13602-KiBqziwoL2@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-218850-13602@https.bugzilla.kernel.org/>
https://bugzilla.kernel.org/show_bug.cgi?id=218850
Theodore Tso (tytso@mit.edu) changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |tytso@mit.edu
Resolution|--- |INVALID
--- Comment #3 from Theodore Tso (tytso@mit.edu) ---
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.
prev parent reply other threads:[~2024-05-27 21:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-16 15:02 [Bug 218850] New: Unexpected failure when write to a file with two file descriptor bugzilla-daemon
2024-05-16 15:19 ` [Bug 218850] " bugzilla-daemon
2024-05-27 7:28 ` bugzilla-daemon
2024-05-27 21:14 ` bugzilla-daemon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-218850-13602-KiBqziwoL2@https.bugzilla.kernel.org/ \
--to=bugzilla-daemon@kernel.org \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).