Skip to content

Commit

Permalink
ocfs2/xattr.c: Fix a bug when inserting xattr.
Browse files Browse the repository at this point in the history
During the process of xatt insertion, we use binary search
to find the right place and "low" is set to it. But when
there is one xattr which has the same name hash as the inserted
one, low is the wrong value. So set it to the right position.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
  • Loading branch information
Tao Ma authored and Mark Fasheh committed Oct 14, 2008
1 parent b0f73cf commit 06b240d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/ocfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -4003,8 +4003,10 @@ static void ocfs2_xattr_set_entry_normal(struct inode *inode,
else if (name_hash <
le32_to_cpu(tmp_xe->xe_name_hash))
high = tmp - 1;
else
else {
low = tmp;
break;
}
}

xe = &xh->xh_entries[low];
Expand Down

0 comments on commit 06b240d

Please sign in to comment.