Skip to contentSkip to conversation

ocfs2/xattr: Fix a bug when inserting xattr.

PATCH New Tao Ma 2 participants 2 messages Sep 19, 2008 – Oct 6, 2008 OCFS2

lore
Share & tools
lore

Tao Ma

author
#0 lore raw

PATCH 1/1 ocfs2/xattr: 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.

---
 fs/ocfs2/xattr.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
fs/ocfs2/xattr.c +3 -1
index e65c8ac..584aef8 100644
@@ -4029,8 +4029,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];
Signature · 1 line
1.5.4.GIT
#1 lore raw

PATCH 1/1 ocfs2/xattr: Fix a bug when inserting xattr.

Quoted 5 lines · Tao Ma

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.

Great, thanks Tao.

	--Mark

--
Mark Fasheh