Re: [PATCH 10/12] NFS: Do not serialise O_DIRECT reads and writes

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

 



On Wed, Jun 15, 2016 at 03:45:37PM +0000, Trond Myklebust wrote:
> Serialisation is not mandatory in POSIX:
> 
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html
> 
> ???Writes can be serialized with respect to other reads and writes. If a read() of file data can be proven (by any means) to occur after a write() of the data, it must reflect that write(), even if the calls are made by different processes. A similar requirement applies to multiple write operations to the same file position. This is needed to guarantee the propagation of data from write() calls to subsequent read() calls. This requirement is particularly significant for networked file systems, where some caching schemes violate these semantics.???

That is the basic defintion, but once O_DSYNC and friends come into
play it gets more complicated:

>From http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html:

    [SIO] [Option Start] If the O_DSYNC and O_RSYNC bits have been set,
    read I/O operations on the file descriptor shall complete as defined
    by synchronized I/O data integrity completion. If the O_SYNC and
    O_RSYNC bits have been set, read I/O operations on the file descriptor
    shall complete as defined by synchronized I/O file integrity completion.
    [Option End]

Which directs to:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html:

     3.378 Synchronized I/O Data Integrity Completion

     For read, when the operation has been completed or diagnosed if
     unsuccessful. The read is complete only when an image of the data
     has been successfully transferred to the requesting process. If
     there were any pending write requests affecting the data to be read
     at the time that the synchronized read operation was requested,
     these write requests are successfully transferred prior to reading
     the data.

     For write, when the operation has been completed or diagnosed if
     unsuccessful. The write is complete only when the data specified in
     the write request is successfully transferred and all file system
     information required to retrieve the data is successfully
     transferred.

     File attributes that are not necessary for data retrieval (access
     time, modification time, status change time) need not be
     successfully transferred prior to returning to the calling process.

While we'll never see O_RSYNC in the kernel glibc treats it as just
O_SYNC.  Either way - I'd be much happier if we could come up with
less different ways to do read/write exclusion rather than more..
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux