linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] jffs2: compare xattr name length first during xattr de-duplication
@ 2019-01-10  3:26 Hou Tao
  0 siblings, 0 replies; only message in thread
From: Hou Tao @ 2019-01-10  3:26 UTC (permalink / raw)
  To: linux-mtd; +Cc: richard.weinberger, boris.brezillon, dwmw2

So unnecessary strcmp can be voided.

Signed-off-by: Hou Tao <houtao1@huawei.com>
---
 fs/jffs2/xattr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c
index da3e18503c65..52aa73afbe10 100644
--- a/fs/jffs2/xattr.c
+++ b/fs/jffs2/xattr.c
@@ -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;
-- 
2.16.2.dirty

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-10  3:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-10  3:26 [PATCH] jffs2: compare xattr name length first during xattr de-duplication Hou Tao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).