mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "suyj.fnst@cn.fujitsu.com" <suyj.fnst@cn.fujitsu.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: About patch NFS: Fix O_DIRECT accounting of number of bytes read/written
Date: Wed, 16 Oct 2019 03:09:29 +0000	[thread overview]
Message-ID: <ee3fc922be7850532a6625a09569b74e24d75b15.camel@hammerspace.com> (raw)
In-Reply-To: <9608C5E5429A7846A89FDA46D5296B97334E3824@G08CNEXMBPEKD03.g08.fujitsu.local>

On Wed, 2019-10-16 at 01:00 +0000, Su, Yanjun wrote:
> Hi trond,
> Because My mail system cant receive nfs mail list’s mails, I reply
> your patch here.
> I have some question for the patch.
> 
> > No. Basic O_DIRECT does not guarantee atomicity of requests, which
> > is
> > why we do not have generic locking at the VFS level when reading
> > and
> > writing. The only guarantee being offered is that O_DIRECT and
> > buffered
> > writes do not collide.
> Do you mean other fs also cant guarantee atomicity of O_DIRECT
> request or just nfs?
> 
> > IOW: I think the basic premise for this test is just broken (as I
> > commented in the patch series I sent) because it is assuming a
> > behaviour that is simply not guaranteed.
> So the generic/465 of xfstests can’t apply to nfs for now, am I
> right?

As far as I can see, it is does not belong in the 'generic' category at
all.

> 
> > BTW: note that buffered writes have the same property. They are
> > ordered
> > when being written into the page cache, meaning that reads on the
> > same
> > client will see no holes, however if you try to read from another
> > client, then you will see the same behaviour, with temporary holes
> > magically appearing in the file.
> As you say, nfs buffered write also has the hole problem with
> multiple r/w on different clients.
> I want to know if the problem exists in other local fs such as
> xfs,ext4?
> 

There is no VFS locking that enforces any serialisation for O_DIRECT.
So unless the filesystem implements its own serialisation (which xfs
does) then there is no guarantee.

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



      reply	other threads:[~2019-10-16  3:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16  1:00 Su, Yanjun
2019-10-16  3:09 ` Trond Myklebust [this message]

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=ee3fc922be7850532a6625a09569b74e24d75b15.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=suyj.fnst@cn.fujitsu.com \
    /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

all inboxes | Powered by JetHome®