Skip to contentSkip to conversation

jffs2: compare xattr name length first during xattr de-duplication

PATCH New Hou Tao 1 participant 1 message Jan 10, 2019

Subsystems (2)
lore
Share & tools
lore

Hou Tao

author
#0 lore raw

PATCH 1/1 jffs2: compare xattr name length first during xattr de-duplication

So unnecessary strcmp can be voided.

---
 fs/jffs2/xattr.c | 1 +
 1 file changed, 1 insertion(+)
fs/jffs2/xattr.c +1 -0
index da3e18503c65..52aa73afbe10 100644
@@ -668,6 +668,7 @@ static int check_xattr_ref_inode(struct jffs2_sb_info *c, struct jffs2_inode_cac
 					goto out;
 			}
 			if (ref->xd->xprefix == cmp->xd->xprefix
+			    && ref->xd->name_len == cmp->xd->name_len
 			    && !strcmp(ref->xd->xname, cmp->xd->xname)) {
 				if (ref->xseqno > cmp->xseqno) {
 					*pcmp = cmp->next;
Signature · 1 line
2.16.2.dirty