public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] nfsd: Set lc_size_chg before ops->proc_layoutcommit
@ 2015-07-07  2:12 Kinglong Mee
  2015-07-07  2:13 ` [PATCH 2/3] nfsd: Fix a memory leak in nfsd4_list_rec_dir() Kinglong Mee
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Kinglong Mee @ 2015-07-07  2:12 UTC (permalink / raw)
  To: J. Bruce Fields, linux-nfs@vger.kernel.org; +Cc: Christoph Hellwig, kinglongmee

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>
---
 fs/nfsd/nfs4proc.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 90cfda7..d112c8a 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;
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-07-09 13:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-07  2:12 [PATCH 1/3] nfsd: Set lc_size_chg before ops->proc_layoutcommit Kinglong Mee
2015-07-07  2:13 ` [PATCH 2/3] nfsd: Fix a memory leak in nfsd4_list_rec_dir() Kinglong Mee
2015-07-08 20:43   ` J. Bruce Fields
2015-07-07  2:16 ` [PATCH 3/3] nfsd: Drop BUG_ON and don't reply SECLABEL when exports migrated Kinglong Mee
2015-07-08 20:44   ` J. Bruce Fields
2015-07-08 18:44 ` [PATCH 1/3] nfsd: Set lc_size_chg before ops->proc_layoutcommit J. Bruce Fields
2015-07-09  8:04   ` Christoph Hellwig
2015-07-09  9:28     ` Kinglong Mee
2015-07-09 13:52     ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox