All of lore.kernel.org
 help / color / mirror / Atom feed
From: "chenxiaosong (A)" <chenxiaosong2@huawei.com>
To: Trond Myklebust <trondmy@hammerspace.com>,
	"anna@kernel.org" <anna@kernel.org>,
	"smayhew@redhat.com" <smayhew@redhat.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"liuyongqiang13@huawei.com" <liuyongqiang13@huawei.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"yi.zhang@huawei.com" <yi.zhang@huawei.com>,
	"zhangxiaoxu5@huawei.com" <zhangxiaoxu5@huawei.com>
Subject: Re: [PATCH -next 1/2] nfs: nfs{,4}_file_flush should consume writeback error
Date: Tue, 12 Apr 2022 22:12:57 +0800	[thread overview]
Message-ID: <ccd017a4-31f1-297f-b2e2-e71eb16f1159@huawei.com> (raw)
In-Reply-To: <0528423f710cd612262666b1533763943c717273.camel@hammerspace.com>

在 2022/4/12 21:56, Trond Myklebust 写道:
> On Tue, 2022-04-12 at 21:46 +0800, chenxiaosong (A) wrote:
>>
>> Other filesystem will _not_ clear writeback error on close().
>> And other filesystem will _not_ clear writeback error on async
>> write() too.
>>
>> Other filesystem _only_ clear writeback error on fsync() or sync
>> write().
>>
> 
> Yes. We might even consider not reporting writeback errors at all in
> close(), since most developers don't check it. We certainly don't want
> to clear those errors there because the manpages don't document that as
> being the case.
> 
>> Should NFS follow the same semantics as all the other filesystems?
> 
> It needs to follow the semantics described in the manpage for write(2)
> and fsync(2) as closely as possible, yes. That documentation is
> supposed to be normative for application developers.
> 
> We won't guarantee to immediately report ENOSPC like other filesystems
> do (because that would require us to only support synchronous writes),
> however that behaviour is already documented in the manpage.
> 
> We may also report some errors that are not documented in the manpage
> (e.g. EACCES or EROFS) simply because those errors cannot always be
> reported at open() time, as would be the case for a local filesystem.
> That's just how the NFS protocol works (particularly for the case of
> the stateless NFSv3 protocol).
> 

After merging your patchset, NFS will clear wb error on async write(), 
is this reasonable?

And more importantly, we can not detect new error by using 
filemap_sample_wb_err()/filemap_sample_wb_err() while nfs_wb_all(),just 
as I described:

```c
   since = filemap_sample_wb_err() = 0
     errseq_sample
       if (!(old & ERRSEQ_SEEN)) // nobody see the error
         return 0;
   nfs_wb_all // no new error
   error = filemap_check_wb_err(..., since) != 0 // unexpected error
```

  reply	other threads:[~2022-04-12 14:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-05 12:46 [PATCH -next 0/2] nfs: check writeback errors correctly ChenXiaoSong
2022-03-05 12:46 ` [PATCH -next 1/2] nfs: nfs{,4}_file_flush should consume writeback error ChenXiaoSong
2022-03-05 16:53   ` Trond Myklebust
2022-03-06  3:54     ` chenxiaosong (A)
2022-03-06 14:04       ` Trond Myklebust
2022-03-06 15:08         ` Trond Myklebust
2022-04-12 13:46           ` chenxiaosong (A)
2022-04-12 13:56             ` Trond Myklebust
2022-04-12 14:12               ` chenxiaosong (A) [this message]
2022-04-12 14:27                 ` Trond Myklebust
2022-04-20  8:50                   ` chenxiaosong (A)
2022-05-09  7:43                     ` chenxiaosong (A)
2022-03-05 12:46 ` [PATCH -next 2/2] nfs: nfs_file_write() check writeback errors correctly ChenXiaoSong
2022-03-05 17:12   ` Trond Myklebust
2022-03-06  8:50     ` chenxiaosong (A)

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=ccd017a4-31f1-297f-b2e2-e71eb16f1159@huawei.com \
    --to=chenxiaosong2@huawei.com \
    --cc=anna@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=liuyongqiang13@huawei.com \
    --cc=smayhew@redhat.com \
    --cc=trondmy@hammerspace.com \
    --cc=yi.zhang@huawei.com \
    --cc=zhangxiaoxu5@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.