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 13:04:23 +0000 (14:04 +0100)
commit10f21087173651d41ea308b4a0c3a13188418aaa
treef1cfe4580b4e5b543e605072967b1bcb2f1a70b1
parent91e43a8500f40108c82e9c82d84571b638529f15
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