aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/filelayout/filelayout.c
diff options
context:
space:
mode:
authorWeston Andros Adamson <dros@primarydata.com>2014-07-17 20:42:19 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-08-03 17:05:26 -0400
commit411a99adffb4f993eee29759f744de01487044ac (patch)
treecea4af52189a179a8001d5ae5c2d5ed28bd5f7d7 /fs/nfs/filelayout/filelayout.c
parente6cf82d1830f5e16a10d566f58db70f297ba5da8 (diff)
nfs: clear_request_commit while holding i_lock
Signed-off-by: Weston Andros Adamson <dros@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/filelayout/filelayout.c')
-rw-r--r--fs/nfs/filelayout/filelayout.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c
index 524e66f6bb9c..1359c4a27393 100644
--- a/fs/nfs/filelayout/filelayout.c
+++ b/fs/nfs/filelayout/filelayout.c
@@ -1009,6 +1009,7 @@ static u32 select_bucket_index(struct nfs4_filelayout_segment *fl, u32 j)
1009 1009
1010/* The generic layer is about to remove the req from the commit list. 1010/* The generic layer is about to remove the req from the commit list.
1011 * If this will make the bucket empty, it will need to put the lseg reference. 1011 * If this will make the bucket empty, it will need to put the lseg reference.
1012 * Note this is must be called holding the inode (/cinfo) lock
1012 */ 1013 */
1013static void 1014static void
1014filelayout_clear_request_commit(struct nfs_page *req, 1015filelayout_clear_request_commit(struct nfs_page *req,
@@ -1016,7 +1017,6 @@ filelayout_clear_request_commit(struct nfs_page *req,
1016{ 1017{
1017 struct pnfs_layout_segment *freeme = NULL; 1018 struct pnfs_layout_segment *freeme = NULL;
1018 1019
1019 spin_lock(cinfo->lock);
1020 if (!test_and_clear_bit(PG_COMMIT_TO_DS, &req->wb_flags)) 1020 if (!test_and_clear_bit(PG_COMMIT_TO_DS, &req->wb_flags))
1021 goto out; 1021 goto out;
1022 cinfo->ds->nwritten--; 1022 cinfo->ds->nwritten--;
@@ -1031,8 +1031,7 @@ filelayout_clear_request_commit(struct nfs_page *req,
1031 } 1031 }
1032out: 1032out:
1033 nfs_request_remove_commit_list(req, cinfo); 1033 nfs_request_remove_commit_list(req, cinfo);
1034 spin_unlock(cinfo->lock); 1034 pnfs_put_lseg_async(freeme);
1035 pnfs_put_lseg(freeme);
1036} 1035}
1037 1036
1038static void 1037static void