summaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorKinglong Mee2015-07-07 04:12:03 +0200
committerJ. Bruce Fields2015-07-20 20:58:46 +0200
commitd8398fc11762d162b2e7b0f368278449899cfbdf (patch)
tree3457fc72a7b8db8d1d100e40784c21a7ef7ff02a /fs/nfsd
parentRevert "Documentation: NFS/RDMA: Document separate Kconfig symbols" (diff)
downloadkernel-qcow2-linux-d8398fc11762d162b2e7b0f368278449899cfbdf.tar.gz
kernel-qcow2-linux-d8398fc11762d162b2e7b0f368278449899cfbdf.tar.xz
kernel-qcow2-linux-d8398fc11762d162b2e7b0f368278449899cfbdf.zip
nfsd: Set lc_size_chg before ops->proc_layoutcommit
After proc_layoutcommit success, i_size_read(inode) always >= new_size. Just set lc_size_chg before proc_layoutcommit, if proc_layoutcommit failed, nfsd will skip the lc_size_chg, so it's no harm. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4proc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 90cfda75313c..d112c8a322d9 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1364,10 +1364,6 @@ nfsd4_layoutcommit(struct svc_rqst *rqstp,
goto out;
}
- nfserr = ops->proc_layoutcommit(inode, lcp);
- if (nfserr)
- goto out_put_stid;
-
if (new_size > i_size_read(inode)) {
lcp->lc_size_chg = 1;
lcp->lc_newsize = new_size;
@@ -1375,7 +1371,7 @@ nfsd4_layoutcommit(struct svc_rqst *rqstp,
lcp->lc_size_chg = 0;
}
-out_put_stid:
+ nfserr = ops->proc_layoutcommit(inode, lcp);
nfs4_put_stid(&ls->ls_stid);
out:
return nfserr;