linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pnfsd-block: cause oops when alloc pnfs_blocklayout_layout_t fail
@ 2013-03-26 10:36 fanchaoting
  2013-04-11 10:23 ` Benny Halevy
  2013-04-24  4:46 ` [PATCH] pnfsd-file: cause oops when stop the nfs server chenditang
  0 siblings, 2 replies; 7+ messages in thread
From: fanchaoting @ 2013-03-26 10:36 UTC (permalink / raw)
  To: Benny Halevy; +Cc: linux-nfs@vger.kernel.org

if using dprintk and alloc pnfs_blocklayout_layout_t fail, it
maybe cause oops. we should assert the new pnfs_blocklayout_layout_t
is not null first.

 Signed-off-by: fanchaoting <fanchaoting@cn.fujitsu.com>
 Reviewed-by: chendt.fnst <chendt.fnst@cn.fujitsu.com>
---
 fs/nfsd/bl_ops.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/nfsd/bl_ops.c b/fs/nfsd/bl_ops.c
index fa129e8..a7046c6 100644
--- a/fs/nfsd/bl_ops.c
+++ b/fs/nfsd/bl_ops.c
@@ -1210,14 +1210,14 @@ layout_cache_fill_from_list(bl_layout_rec_t *r, struct list_head *h,
 			n = bll_alloc(seg->offset,
 			    MIN(seg->length, BLL_F_END(b) - seg->offset),
 			    BLOCK_LAYOUT_CACHE, h);
+			if (!n)
+				return False;
+
 			dprintk("  CACHE hit: Found %Lu(f):%Lu(l): "
 			    "in %Lu(f):%Lu(l):%Lu(s):%d\n",
 			    _2SECTS(n->bll_foff), _2SECTS(n->bll_len),
 			    _2SECTS(b->bll_foff), _2SECTS(b->bll_len),
 			    _2SECTS(b->bll_soff), b->bll_es);
-			if (!n)
-				return False;
-			
 			n->bll_soff = b->bll_soff + seg->offset - b->bll_foff;
 			n->bll_vol_id.sbid = sbid;
 			n->bll_vol_id.devid = b->bll_vol_id.devid;
-- 
1.5.5.1



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

end of thread, other threads:[~2013-11-21  7:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-26 10:36 [PATCH] pnfsd-block: cause oops when alloc pnfs_blocklayout_layout_t fail fanchaoting
2013-04-11 10:23 ` Benny Halevy
2013-04-24  4:46 ` [PATCH] pnfsd-file: cause oops when stop the nfs server chenditang
2013-09-25 14:58   ` Benny Halevy
2013-11-20 16:40     ` Christoph Hellwig
2013-11-21  7:00       ` Benny Halevy
2013-11-21  7:19         ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).