Re: Question about O_APPEND | O_DIRECT

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

 



On Mon, 2023-11-27 at 08:36 -0800, Christoph Hellwig wrote:
> On Mon, Nov 27, 2023 at 03:28:16PM +0000, Tao Lyu wrote:
> > 
> > O_APPEND | O_DIRECT can be used to bypass the client cache for
> > multiple threads writing data without caring of the orders (e.g.,
> > logs).
> > 
> > Yes, to support O_APPEND | O_DIRECT, NFS must first support APPEND.
> > But the key point is that looks like NFS has supported O_APPEND
> > already.
> > I can successfully open a file with "O_RDWR|O_APPEND".
> > 
> > My confusion is why NFS supports O_RDWR and O_APPEND individually
> > but does not support this combination.
> 
> Well, it does support O_RDWR|O_APPEND, just not with O_DIRECT?
> 
> Btw, I think an APPEND operation in NFS would be a very good idea,
> and
> I'd love to work with interested parties in the IETF on it.  Not that
> we (Damien to be specific) plan to add support to Linux to also
> report
> the actual offset an O_APPEND write wrote to through io_uring as we
> have varios use cases for out of place write data stores for that.
> It would be great to also support that programming model over NFS.
> 

Note that APPEND would only really work with O_DIRECT, since it is
anathema to cached I/O to not be able to control the placement of the
data. However it is useful for the case where you want to write logs.

In addition, the model will always break down if someone decides they
want to write a log entry of size > wsize. Once you have to split up
the data, you (obviously) lose the atomicity you need in order to write
a contiguous record.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@xxxxxxxxxxxxxxx






[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