Skip to contentSkip to conversation

ocfs2-add-necessary-check-in-case-sb_getblk-fails.patch removed from -mm tree

merged [email protected] 1 participant 1 message Nov 13, 2013 OCFS2

lore
Share & tools
lore
#0 lore raw

Subject: [merged] ocfs2-add-necessary-check-in-case-sb_getblk-fails.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Wed, 13 Nov 2013 12:37:14 -0800

The patch titled
Subject: ocfs2: add necessary check in case sb_getblk() fails
has been removed from the -mm tree. Its filename was
ocfs2-add-necessary-check-in-case-sb_getblk-fails.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Rui Xiang <[email protected]>
Subject: ocfs2: add necessary check in case sb_getblk() fails

sb_getblk() may return an err, so add a check for bh.

[[email protected]: also add a check after calling sb_getblk() in ocfs2_create_xattr_block()]
Cc Joel Becker <[email protected]>
Cc Joseph Qi <[email protected]>

---

 fs/ocfs2/refcounttree.c |    5 +++++
 fs/ocfs2/xattr.c        |    6 ++++++
 2 files changed, 11 insertions(+)
fs/ocfs2/refcounttree.c renamed from fs/ocfs2/refcounttree.c~ocfs2-add-necessary-check-in-case-sb_getblk-fails +5 -0
diff -puN fs/ocfs2/refcounttree.c~ocfs2-add-necessary-check-in-case-sb_getblk-fails 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,
fs/ocfs2/xattr.c renamed from fs/ocfs2/xattr.c~ocfs2-add-necessary-check-in-case-sb_getblk-fails +6 -0
diff -puN fs/ocfs2/xattr.c~ocfs2-add-necessary-check-in-case-sb_getblk-fails fs/ocfs2/xattr.c
@@ -2864,6 +2864,12 @@ static int ocfs2_create_xattr_block(stru
 	}
 
 	new_bh = sb_getblk(inode->i_sb, first_blkno);
+	if (!new_bh) {
+		ret = -ENOMEM;
+		mlog_errno(ret);
+		goto end;
+	}
+
 	ocfs2_set_new_buffer_uptodate(INODE_CACHE(inode), new_bh);
 
 	ret = ocfs2_journal_access_xb(ctxt->handle, INODE_CACHE(inode),

_

Patches currently in -mm which might be from [email protected] are

origin.patch