summaryrefslogtreecommitdiffstats
path: root/fs/nfs/callback_proc.c
diff options
context:
space:
mode:
authorChristoph Hellwig2014-09-10 17:23:29 +0200
committerTrond Myklebust2014-09-10 21:47:02 +0200
commit7c5d187581f57657de79e795602d9f1a0254c88c (patch)
tree9e316ee5e0f348dc56244461255356eb6f8d2933 /fs/nfs/callback_proc.c
parentNFS: Fix a compile warning when !(CONFIG_NFS_V3 || CONFIG_NFS_V4) (diff)
downloadkernel-qcow2-linux-7c5d187581f57657de79e795602d9f1a0254c88c.tar.gz
kernel-qcow2-linux-7c5d187581f57657de79e795602d9f1a0254c88c.tar.xz
kernel-qcow2-linux-7c5d187581f57657de79e795602d9f1a0254c88c.zip
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,
goto out;
ino = lo->plh_inode;
+
+ spin_lock(&ino->i_lock);
+ pnfs_set_layout_stateid(lo, &args->cbl_stateid, true);
+ spin_unlock(&ino->i_lock);
+
+ pnfs_layoutcommit_inode(ino, false);
+
spin_lock(&ino->i_lock);
if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags) ||
pnfs_mark_matching_lsegs_invalid(lo, &free_me_list,
@@ -178,7 +185,6 @@ static u32 initiate_file_draining(struct nfs_client *clp,
rv = NFS4ERR_DELAY;
else
rv = NFS4ERR_NOMATCHING_LAYOUT;
- pnfs_set_layout_stateid(lo, &args->cbl_stateid, true);
spin_unlock(&ino->i_lock);
pnfs_free_lseg_list(&free_me_list);
pnfs_put_layout_hdr(lo);