public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: linux-man@vger.kernel.org
Subject: [Bug 214873] man 2 fsync implies possibility to return early
Date: Fri, 12 Nov 2021 21:22:17 +0000	[thread overview]
Message-ID: <bug-214873-11311-zxrzKiw7Om@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-214873-11311@https.bugzilla.kernel.org/>

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

Jens Axboe (axboe@kernel.dk) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |axboe@kernel.dk

--- Comment #7 from Jens Axboe (axboe@kernel.dk) ---
This is still mixing up multiple things. There are two things to consider here:

1) The dirty page cache for the file/device. This is what the kernel knows
about, and fsync will flush all of it.

2) The device side potential write back cache. The kernel has no knowledge of
the state of this. The kernel will issue a synchronize cache command for the
device, upon which the device should ensure that all previously acked data is
now on stable storage (eg the cache is clean).

The kernel will ensure that _all_ dirty cache is flushed out to the device, and
then it will issue a flush command. That's all the kernel can do, and it will
not leave dirty data unwritten for that mapping when fsync(2) is invoked.
That's outside of errors that can happen, for which fsync(2) will return an
error.

There's no issue here, outside of the potential buggy device case. For that
case, the kernel still does what it's supposed to, which is flush all dirty
kernel cache to the device. If the device is buggy and doesn't commit it to
stable storage when a synchronize cache command is issued, the kernel has no
knowledge of this nor is there anything it can do about it. There's no early
return _unless_ the device is buggy! The man page clearly states that the call
blocks until the device has told you that the data is stable. If the device
violates the storage standards it belongs to, then you are likely screwed in
more ways than just this one.

Please close this one.

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

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

  parent reply	other threads:[~2021-11-12 21:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 21:25 [Bug 214873] New: man 2 fsync implies possibility to return early bugzilla-daemon
2021-10-30 12:05 ` [Bug 214873] " bugzilla-daemon
2021-10-30 15:17 ` bugzilla-daemon
2021-10-30 19:03 ` bugzilla-daemon
2021-10-31 12:33 ` bugzilla-daemon
2021-11-07 23:24 ` bugzilla-daemon
2021-11-12 20:22 ` bugzilla-daemon
2021-11-12 21:22 ` bugzilla-daemon [this message]
2021-11-12 23:38 ` bugzilla-daemon

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-214873-11311-zxrzKiw7Om@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=linux-man@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