Thread (3 messages) 3 messages, 2 authors, 2012-05-31

Re: [PATCH] target/file: Drop O_SYNC in favor of implict vfs_fsync_range for writes

From: Christoph Hellwig <hch@lst.de>
Date: 2012-05-31 05:42:47
Also in: linux-fsdevel, lkml

On Wed, May 30, 2012 at 11:57:43PM +0000, Nicholas A. Bellinger wrote:
From: Nicholas Bellinger <redacted>

This patch converts fd_execute_cmd() code to drop O_SYNC usage
(the original default) in favor of always preforming an implict
SCSI forced unit access (FUA) operation using vfs_fsync_range()
based on LBA + SectorCount after each completed FILEIO backend write.

This conversion was inspired by Linus's thoughts on O_SYNC usage in
the thread: http://www.spinics.net/lists/linux-fsdevel/msg55681.html

  "O_SYNC is the absolutely anti-thesis of that kind of "multiple levels
   of overlapping IO". Because it requires that the IO is _done_ by the
   time you start more, which is against the whole point."

This patch also drops the now unnecessary fd_buffered_io= token usage
at createvirtdev time.  Tested with lio-core code using fio writeverify
to local tcm_loop + FILEIO <-> scsi_debug backed LUNs.
If you look at the implementation O_SYNC really just means an implicit
vfs_fsync_range after each write, thus I can't see how this patch makes any
difference.

For target use with WCE=0 semantics you could at least switch to O_DSYNC, though.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help