NFS: Fix up commit deadlocks
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 4 Oct 2021 19:37:42 +0000 (15:37 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:17:02 +0000 (19:17 +0100)
commit9443fcc22a6cbe0caf1c83f756a0416e83ddb07f
tree9053cc6d90873d56125b751e53a8a3ccb0304879
parentb07aa21474d3e6c84eb4e3838b6f3da0789f4fdb
NFS: Fix up commit deadlocks

[ Upstream commit 133a48abf6ecc535d7eddc6da1c3e4c972445882 ]

If O_DIRECT bumps the commit_info rpcs_out field, then that could lead
to fsync() hangs. The fix is to ensure that O_DIRECT calls
nfs_commit_end().

Fixes: 723c921e7dfc ("sched/wait, fs/nfs: Convert wait_on_atomic_t() usage to the new wait_var_event() API")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/direct.c
fs/nfs/pnfs_nfs.c
fs/nfs/write.c
include/linux/nfs_fs.h