Re: [PATCH -next 1/2] nfs: nfs{,4}_file_flush should consume writeback error

From: chenxiaosong (A)
Date: Mon May 09 2022 - 03:51:29 EST


在 2022/4/20 16:50, chenxiaosong (A) 写道:
在 2022/4/12 22:27, Trond Myklebust 写道:


It will clear ENOSPC, EDQUOT and EFBIG. It should not clear other
errors that are not supposed to be reported by write().

As I keep repeating, that is _documented behaviour_!


Hi Trond:

You may mean that write(2) manpage described:

Since Linux 4.13, errors from write-back come with a promise that
they may be reported by subsequent.  write(2) requests, and will be
reported by a subsequent fsync(2) (whether or not they were also
reported by write(2)).

The manpage mentioned that "reported by a subsequent fsync(2)", your patch[1] clear the wb err on _async_ write(), and wb err will _not_ be reported by subsequent fsync(2), is it documented behaviour?

All other filesystems will _not_ clear any wb err on _async_ write().

[1] https://patchwork.kernel.org/project/linux-nfs/patch/20220411213346.762302-4-trondmy@xxxxxxxxxx/


Hi Trond:

write(2) manpage described:

On some filesystems, including NFS, it does not even guarantee that
space has successfully been reserved for the data. In this case, some
errors might be delayed until a future write(2), fsync(2), or even
close(2). The only way to be sure is to call fsync(2) after you are
done writing all your data.

Maybe it mean that: writeback errors of NFS is delayed until future sync write() and fsync(), because sync write() will call fsync(). We all agreed that close()->flush() should not clear writeback errors, should async write() do the same thing like other filesystems?