All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@tonian.com>
To: fanchaoting <fanchaoting@cn.fujitsu.com>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] pnfsd-block: cause oops when alloc pnfs_blocklayout_layout_t fail
Date: Thu, 11 Apr 2013 13:23:38 +0300	[thread overview]
Message-ID: <51668F2A.5060301@tonian.com> (raw)
In-Reply-To: <51517A15.3010805@cn.fujitsu.com>

On 2013-03-26 12:36, fanchaoting wrote:
> 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>

Merged into the pnfsd-block branch.

Thanks,

Benny


> ---
>  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;
> 

  reply	other threads:[~2013-04-11 10:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51668F2A.5060301@tonian.com \
    --to=bhalevy@tonian.com \
    --cc=fanchaoting@cn.fujitsu.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.