public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] nfsd: Fix a file leak of ls_file if nfsd4_layout_setlease fail
@ 2015-07-03 11:32 Kinglong Mee
  2015-07-03 11:34 ` [PATCH 2/5] nfsd: Drop including client's header file nfs_fs.h Kinglong Mee
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Kinglong Mee @ 2015-07-03 11:32 UTC (permalink / raw)
  To: J. Bruce Fields, linux-nfs@vger.kernel.org; +Cc: Christoph Hellwig, kinglongmee

If nfsd4_layout_setlease fail, nfsd will not put ls->ls_file.

Fix commit c5c707f96f "nfsd: implement pNFS layout recalls".

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfsd/nfs4layouts.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c
index 6904213..367a65a 100644
--- a/fs/nfsd/nfs4layouts.c
+++ b/fs/nfsd/nfs4layouts.c
@@ -212,8 +212,7 @@ nfsd4_alloc_layout_stateid(struct nfsd4_compound_state *cstate,
 	BUG_ON(!ls->ls_file);
 
 	if (nfsd4_layout_setlease(ls)) {
-		put_nfs4_file(fp);
-		kmem_cache_free(nfs4_layout_stateid_cache, ls);
+		nfs4_put_stid(stp);
 		return NULL;
 	}
 
-- 
2.4.3


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

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

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-03 11:32 [PATCH 1/5] nfsd: Fix a file leak of ls_file if nfsd4_layout_setlease fail Kinglong Mee
2015-07-03 11:34 ` [PATCH 2/5] nfsd: Drop including client's header file nfs_fs.h Kinglong Mee
2015-07-03 11:36 ` [PATCH 3/5] nfsd: Remove duplicate define of IDMAP_NAMESZ/IDMAP_TYPE_xx Kinglong Mee
2015-07-03 11:38 ` [PATCH 4/5] nfsd: Check stateid generation in nfsd4_lookup_stateid() Kinglong Mee
2015-07-08 21:42   ` J. Bruce Fields
2015-07-09 10:51     ` Kinglong Mee
2015-07-03 11:39 ` [PATCH 5/5] nfsd: Add macro NFS_ACL_MASK for ACL Kinglong Mee
2015-07-08 21:45   ` J. Bruce Fields
2015-07-08 21:30 ` [PATCH 1/5] nfsd: Fix a file leak of ls_file if nfsd4_layout_setlease fail J. Bruce Fields
2015-07-09  8:12   ` Christoph Hellwig
2015-07-09  9:31     ` Kinglong Mee
2015-07-09  9:38       ` [PATCH v2] " Kinglong Mee
2015-07-09 16:19         ` 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