]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 15 Mar 2018 21:29:17 +0000 (18:29 -0300)
commiteaf088db34c2ad92216aaf225163f44978e96b98
treec2e014cfc90aadfd6f4e74fe3da748bf8c49c7fe
parent39add0e3464764eaaa866c2d6add1e4975f22345
NFS: Fix unstable write completion

BugLink: http://bugs.launchpad.net/bugs/1756100
commit c4f24df942a181699c5bab01b8e5e82b925f77f3 upstream.

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: dc4fd9ab01ab ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
fs/nfs/write.c