diff options
author | Tao Ma <tao.ma@oracle.com> | 2008-09-19 10:16:34 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-10-13 20:02:43 -0400 |
commit | 06b240d8af21ddee4cfec3b0f02b81d9f168a98a (patch) | |
tree | eb725cc51e755252b17efb235db4c9d9adeb7469 /fs | |
parent | b0f73cfc36ed62decdd3f78e943bbfd00ee80e49 (diff) |
ocfs2/xattr.c: Fix a bug when inserting xattr.
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/xattr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index b2e25a828e38..b1f2a164e7dc 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -4003,8 +4003,10 @@ static void ocfs2_xattr_set_entry_normal(struct inode *inode, | |||
4003 | else if (name_hash < | 4003 | else if (name_hash < |
4004 | le32_to_cpu(tmp_xe->xe_name_hash)) | 4004 | le32_to_cpu(tmp_xe->xe_name_hash)) |
4005 | high = tmp - 1; | 4005 | high = tmp - 1; |
4006 | else | 4006 | else { |
4007 | low = tmp; | ||
4007 | break; | 4008 | break; |
4009 | } | ||
4008 | } | 4010 | } |
4009 | 4011 | ||
4010 | xe = &xh->xh_entries[low]; | 4012 | xe = &xh->xh_entries[low]; |