]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From: Tao Ma <tao.ma@oracle.com> |
2 | Subject: ocfs2/xattr.c: Fix a bug when inserting xattr. | |
3 | Patch-mainline: 2.6.28 | |
4 | ||
5 | During the process of xatt insertion, we use binary search | |
6 | to find the right place and "low" is set to it. But when | |
7 | there is one xattr which has the same name hash as the inserted | |
8 | one, low is the wrong value. So set it to the right position. | |
9 | ||
10 | Signed-off-by: Tao Ma <tao.ma@oracle.com> | |
11 | Signed-off-by: Mark Fasheh <mfasheh@suse.com> | |
12 | --- | |
13 | fs/ocfs2/xattr.c | 4 +++- | |
14 | 1 files changed, 3 insertions(+), 1 deletions(-) | |
15 | ||
16 | Index: linux-2.6.27/fs/ocfs2/xattr.c | |
17 | =================================================================== | |
18 | --- linux-2.6.27.orig/fs/ocfs2/xattr.c | |
19 | +++ linux-2.6.27/fs/ocfs2/xattr.c | |
20 | @@ -4019,8 +4019,10 @@ static void ocfs2_xattr_set_entry_normal | |
21 | else if (name_hash < | |
22 | le32_to_cpu(tmp_xe->xe_name_hash)) | |
23 | high = tmp - 1; | |
24 | - else | |
25 | + else { | |
26 | + low = tmp; | |
27 | break; | |
28 | + } | |
29 | } | |
30 | ||
31 | xe = &xh->xh_entries[low]; |