提交 06b240d8 编写于 作者: T Tao Ma 提交者: Mark Fasheh

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: NTao Ma <tao.ma@oracle.com>
Signed-off-by: NMark Fasheh <mfasheh@suse.com>
上级 b0f73cfc
...@@ -4003,8 +4003,10 @@ static void ocfs2_xattr_set_entry_normal(struct inode *inode, ...@@ -4003,8 +4003,10 @@ static void ocfs2_xattr_set_entry_normal(struct inode *inode,
else if (name_hash < else if (name_hash <
le32_to_cpu(tmp_xe->xe_name_hash)) le32_to_cpu(tmp_xe->xe_name_hash))
high = tmp - 1; high = tmp - 1;
else else {
low = tmp;
break; break;
}
} }
xe = &xh->xh_entries[low]; xe = &xh->xh_entries[low];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册