From: Darrick J. Wong Date: Thu, 12 Apr 2018 15:34:08 +0000 (-0500) Subject: xfs_scrub: only run ascii name checks if unicode name checker X-Git-Tag: v4.16.0-rc1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55290cfc7c08e92489e9564145596c0b063217b4;p=thirdparty%2Fxfsprogs-dev.git xfs_scrub: only run ascii name checks if unicode name checker Skip the ASCII name checks if the Unicode name checker is going to run, since the latter covers everything that the former does. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- diff --git a/scrub/phase5.c b/scrub/phase5.c index e0e7e8c71..01038f778 100644 --- a/scrub/phase5.c +++ b/scrub/phase5.c @@ -113,11 +113,11 @@ xfs_scrub_scan_dirents( dentry = readdir(dir); while (dentry) { - moveon = xfs_scrub_check_name(ctx, descr, _("directory"), - dentry->d_name); - if (!moveon) - break; - moveon = unicrash_check_dir_name(uc, descr, dentry); + if (uc) + moveon = unicrash_check_dir_name(uc, descr, dentry); + else + moveon = xfs_scrub_check_name(ctx, descr, + _("directory"), dentry->d_name); if (!moveon) break; dentry = readdir(dir); @@ -161,7 +161,7 @@ xfs_scrub_scan_fhandle_namespace_xattrs( char keybuf[XATTR_NAME_MAX + 1]; struct attrlist *attrlist = (struct attrlist *)attrbuf; struct attrlist_ent *ent; - struct unicrash *uc; + struct unicrash *uc = NULL; bool moveon = true; int i; int error; @@ -181,11 +181,13 @@ xfs_scrub_scan_fhandle_namespace_xattrs( ent = ATTR_ENTRY(attrlist, i); snprintf(keybuf, XATTR_NAME_MAX, "%s.%s", attr_ns->name, ent->a_name); - moveon = xfs_scrub_check_name(ctx, descr, - _("extended attribute"), keybuf); - if (!moveon) - goto out; - moveon = unicrash_check_xattr_name(uc, descr, keybuf); + if (uc) + moveon = unicrash_check_xattr_name(uc, descr, + keybuf); + else + moveon = xfs_scrub_check_name(ctx, descr, + _("extended attribute"), + keybuf); if (!moveon) goto out; }