From: Tao Ma Date: Fri, 19 Sep 2008 14:16:34 +0000 (+0800) Subject: ocfs2/xattr.c: Fix a bug when inserting xattr. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=06b240d8af21ddee4cfec3b0f02b81d9f168a98a;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Mark Fasheh --- 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, 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];