ocfs2: Check errors from ocfs2_xattr_update_xattr_search()
authorJoel Becker <joel.becker@oracle.com>
Tue, 21 Oct 2008 01:25:56 +0000 (18:25 -0700)
committerMark Fasheh <mfasheh@suse.com>
Mon, 10 Nov 2008 17:51:45 +0000 (09:51 -0800)
The ocfs2_xattr_update_xattr_search() function can return an error when
trying to read blocks off of disk.  The caller needs to check this error
before using those (possibly invalid) blocks.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
fs/ocfs2/xattr.c

index 41a6ca004ae37f2f7bc3815cf89b9bf48d8094ae..92df88a41e5d0923b7713ed5c0c924ff65e48393 100644 (file)
@@ -2825,7 +2825,11 @@ static int ocfs2_xattr_create_index_block(struct inode *inode,
        if (data_bh)
                ocfs2_journal_dirty(handle, data_bh);
 
-       ocfs2_xattr_update_xattr_search(inode, xs, xb_bh, xh_bh);
+       ret = ocfs2_xattr_update_xattr_search(inode, xs, xb_bh, xh_bh);
+       if (ret) {
+               mlog_errno(ret);
+               goto out_commit;
+       }
 
        /* Change from ocfs2_xattr_header to ocfs2_xattr_tree_root */
        memset(&xb->xb_attrs, 0, inode->i_sb->s_blocksize -