aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/callback_proc.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-09-10 11:23:29 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-09-10 15:47:02 -0400
commit7c5d187581f57657de79e795602d9f1a0254c88c (patch)
tree9e316ee5e0f348dc56244461255356eb6f8d2933 /fs/nfs/callback_proc.c
parent3a3908c8b09d5ec19d543836d4f38d240ae27fe8 (diff)
pnfs: force a layout commit when encountering busy segments during recall
Expedite layout recall processing by forcing a layout commit when we see busy segments. Without it the layout recall might have to wait until the VM decided to start writeback for the file, which can introduce long delays. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/callback_proc.c')
-rw-r--r--fs/nfs/callback_proc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index 41db5258e7a7..0d269515c64d 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -171,6 +171,13 @@ static u32 initiate_file_draining(struct nfs_client *clp,
171 goto out; 171 goto out;
172 172
173 ino = lo->plh_inode; 173 ino = lo->plh_inode;
174
175 spin_lock(&ino->i_lock);
176 pnfs_set_layout_stateid(lo, &args->cbl_stateid, true);
177 spin_unlock(&ino->i_lock);
178
179 pnfs_layoutcommit_inode(ino, false);
180
174 spin_lock(&ino->i_lock); 181 spin_lock(&ino->i_lock);
175 if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags) || 182 if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags) ||
176 pnfs_mark_matching_lsegs_invalid(lo, &free_me_list, 183 pnfs_mark_matching_lsegs_invalid(lo, &free_me_list,
@@ -178,7 +185,6 @@ static u32 initiate_file_draining(struct nfs_client *clp,
178 rv = NFS4ERR_DELAY; 185 rv = NFS4ERR_DELAY;
179 else 186 else
180 rv = NFS4ERR_NOMATCHING_LAYOUT; 187 rv = NFS4ERR_NOMATCHING_LAYOUT;
181 pnfs_set_layout_stateid(lo, &args->cbl_stateid, true);
182 spin_unlock(&ino->i_lock); 188 spin_unlock(&ino->i_lock);
183 pnfs_free_lseg_list(&free_me_list); 189 pnfs_free_lseg_list(&free_me_list);
184 pnfs_put_layout_hdr(lo); 190 pnfs_put_layout_hdr(lo);