Skip to content

Commit

Permalink
ocfs2: Check errors from ocfs2_xattr_update_xattr_search()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joel Becker authored and Mark Fasheh committed Nov 10, 2008
1 parent b37c4d8 commit bd60bd3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/ocfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
Expand Down

0 comments on commit bd60bd3

Please sign in to comment.