Subject: + ocfs2-add-necessary-check-in-case-sb_getblk-fails.patch added to -mm tree To: rui.xiang@xxxxxxxxxx,jeff.liu@xxxxxxxxxx,jlbec@xxxxxxxxxxxx,mfasheh@xxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Tue, 17 Sep 2013 16:26:25 -0700 The patch titled Subject: ocfs2: add necessary check in case sb_getblk() fails has been added to the -mm tree. Its filename is ocfs2-add-necessary-check-in-case-sb_getblk-fails.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/ocfs2-add-necessary-check-in-case-sb_getblk-fails.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/ocfs2-add-necessary-check-in-case-sb_getblk-fails.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Rui Xiang <rui.xiang@xxxxxxxxxx> Subject: ocfs2: add necessary check in case sb_getblk() fails sb_getblk() may return an err, so add a check for bh. Signed-off-by: Rui Xiang <rui.xiang@xxxxxxxxxx> Reviewed-by: Jie Liu <jeff.liu@xxxxxxxxxx> Cc: Mark Fasheh <mfasheh@xxxxxxxx> Cc: Joel Becker <jlbec@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/ocfs2/refcounttree.c | 5 +++++ 1 file changed, 5 insertions(+) diff -puN fs/ocfs2/refcounttree.c~ocfs2-add-necessary-check-in-case-sb_getblk-fails fs/ocfs2/refcounttree.c --- a/fs/ocfs2/refcounttree.c~ocfs2-add-necessary-check-in-case-sb_getblk-fails +++ a/fs/ocfs2/refcounttree.c @@ -612,6 +612,11 @@ static int ocfs2_create_refcount_tree(st } 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, _ Patches currently in -mm which might be from rui.xiang@xxxxxxxxxx are ocfs2-return-enomem-when-sb_getblk-fails.patch ocfs2-add-necessary-check-in-case-sb_getblk-fails.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html