Linux ocfs2 filesystem development
 help / color / mirror / Atom feed
From: Jeff Liu <jeff.liu@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 2/2] ocfs2: add necessary check in case sb_getblk fails
Date: Tue, 03 Sep 2013 16:16:44 +0800	[thread overview]
Message-ID: <52259AEC.9040205@oracle.com> (raw)
In-Reply-To: <1378191640-3844-2-git-send-email-rui.xiang@huawei.com>

On 09/03/2013 03:00 PM, Rui Xiang wrote:

> Sb_getblk may retrun an err, so add a check for bh.
> 
> Signed-off-by: Rui Xiang <rui.xiang@huawei.com>

Reviewed-by: Jie Liu <jeff.liu@oracle.com>

> ---
>  fs/ocfs2/refcounttree.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
> index 50c1796..22f3f19 100644
> --- a/fs/ocfs2/refcounttree.c
> +++ b/fs/ocfs2/refcounttree.c
> @@ -612,6 +612,11 @@ static int ocfs2_create_refcount_tree(struct inode *inode,
>  	}
>  
>  	new_bh = sb_getblk(inode->i_sb, first_blkno);
> +	if (!new_bh) {
> +		ret = -ENOMEM;
> +		mlog_errno(ret);
> +		goto out_commit;
> +	}
>  	ocfs2_set_new_buffer_uptodate(&new_tree->rf_ci, new_bh);
>  
>  	ret = ocfs2_journal_access_rb(handle, &new_tree->rf_ci, new_bh,

  reply	other threads:[~2013-09-03  8:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03  7:00 [Ocfs2-devel] [PATCH 1/2] ocfs2: return ENOMEM while sb_getblk failing Rui Xiang
2013-09-03  7:00 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: add necessary check in case sb_getblk fails Rui Xiang
2013-09-03  8:16   ` Jeff Liu [this message]
2013-09-03  8:14 ` [Ocfs2-devel] [PATCH 1/2] ocfs2: return ENOMEM while sb_getblk failing Jeff Liu
  -- strict thread matches above, loose matches on Subject: below --
2013-09-03  6:53 Rui Xiang
2013-09-03  6:53 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: add necessary check in case sb_getblk fails Rui Xiang
2013-09-02 11:17 [Ocfs2-devel] [PATCH 1/2] ocfs2: return ENOMEM while sb_getblk failing Rui Xiang
2013-09-02 11:17 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: add necessary check in case sb_getblk fails Rui Xiang

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=52259AEC.9040205@oracle.com \
    --to=jeff.liu@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox