aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/direct.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2021-10-04 15:37:42 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2021-10-20 18:09:45 -0400
commit133a48abf6ecc535d7eddc6da1c3e4c972445882 (patch)
tree728289e9049585b06b92c260117e4b78314d1e3b /fs/nfs/direct.c
parentNFS: Fix deadlocks in nfs_scan_commit_list() (diff)
downloadlinux-dev-133a48abf6ecc535d7eddc6da1c3e4c972445882.tar.xz
linux-dev-133a48abf6ecc535d7eddc6da1c3e4c972445882.zip
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>
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r--fs/nfs/direct.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 2e894fec036b..3c0335c15a73 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -620,7 +620,7 @@ static void nfs_direct_commit_complete(struct nfs_commit_data *data)
nfs_unlock_and_release_request(req);
}
- if (atomic_dec_and_test(&cinfo.mds->rpcs_out))
+ if (nfs_commit_end(cinfo.mds))
nfs_direct_write_complete(dreq);
}