public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* loop: it looks like REQ_OP_FLUSH could return before IO completion.
@ 2022-03-19 17:14 Eric Wheeler
  2022-03-21  0:21 ` Ming Lei
  0 siblings, 1 reply; 12+ messages in thread
From: Eric Wheeler @ 2022-03-19 17:14 UTC (permalink / raw)
  To: linux-block

Hello all,

In loop.c do_req_filebacked() for REQ_OP_FLUSH, lo_req_flush() is called: 
it does not appear that lo_req_flush() does anything to make sure 
ki_complete has been called for pending work, it just calls vfs_fsync().

Is this a consistency problem?

For example, if the loop driver has queued async kiocb's to the filesystem 
via .read_iter/.write_iter, is it the filesystem's responsibility to 
complete that work before returning from vfs_sync() or is it possible that 
the vfs_sync() completes before ->ki_complete() is called?

Relatedly, does vfs_fsync() do anything for direct IO?  Ultimately 
f_op->fsync() is called so maybe the FS is told to commit its structures 
like sparse allocations that may not be on disk yet.


--
Eric Wheeler

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-04-17 16:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-19 17:14 loop: it looks like REQ_OP_FLUSH could return before IO completion Eric Wheeler
2022-03-21  0:21 ` Ming Lei
2022-03-23  6:14   ` Eric Wheeler
2022-04-13 22:49     ` Eric Wheeler
2022-04-14  0:15       ` Ming Lei
2022-04-14  0:28       ` Ming Lei
2022-04-15  2:10         ` Eric Wheeler
2022-04-15 14:29           ` Ming Lei
2022-04-16  5:18             ` Christoph Hellwig
2022-04-16 20:05               ` Eric Wheeler
2022-04-17  0:59                 ` Jens Axboe
2022-04-17 16:32                   ` Eric Wheeler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox