NFS: Fix up commit deadlocks
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 4 Oct 2021 19:37:42 +0000 (15:37 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 20 Oct 2021 22:09:45 +0000 (18:09 -0400)
commit133a48abf6ecc535d7eddc6da1c3e4c972445882
tree728289e9049585b06b92c260117e4b78314d1e3b
parent64a93dbf25d3a1368bb58ddf0f61d0a92d7479e3
NFS: Fix up commit deadlocks

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>
fs/nfs/direct.c
fs/nfs/pnfs_nfs.c
fs/nfs/write.c
include/linux/nfs_fs.h