]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: Fix unstable write completion
authorTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 7 Mar 2018 20:22:31 +0000 (15:22 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 8 Mar 2018 17:56:32 +0000 (12:56 -0500)
commit3ee31b2cd5737cd72c70cbfc83d14380e61941d5
tree8ee1067aaac971f1de07c609dc17f2fa03a3b69c
parentac3aa62975e5a26acaef8f28195e547d399d83c6
NFS: Fix unstable write completion

We do want to respect the FLUSH_SYNC argument to nfs_commit_inode() to
ensure that all outstanding COMMIT requests to the inode in question are
complete. Currently we may exit early from both nfs_commit_inode() and
nfs_write_inode() even if there are COMMIT requests in flight, or unstable
writes on the commit list.

In order to get the right semantics w.r.t. sync_inode(), we don't need
to have nfs_commit_inode() reset the inode dirty flags when called from
nfs_wb_page() and/or nfs_wb_all(). We just need to ensure that
nfs_write_inode() leaves them in the right state if there are outstanding
commits, or stable pages.

Reported-by: Scott Mayhew <smayhew@redhat.com>
Fixes: 759be3a0ef42 ("nfs: don't wait on commit in nfs_commit_inode()...")
Cc: stable@vger.kernel.org # v4.14+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/write.c