diff mbox

[03/14] xfs_scrub: don't complain about different normalization

Message ID 152160359862.8288.13397778165305364775.stgit@magnolia (mailing list archive)
State Accepted
Headers show

Commit Message

Darrick J. Wong March 21, 2018, 3:39 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Since there are different ways to normalize utf8 names, don't complain
when we find a name that is normalized in a different way than the NFKC
that we use to find duplicate names.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 scrub/unicrash.c |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Eric Sandeen April 10, 2018, 11:37 p.m. UTC | #1
On 3/20/18 10:39 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Since there are different ways to normalize utf8 names, don't complain
> when we find a name that is normalized in a different way than the NFKC
> that we use to find duplicate names.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

insofar as I understand any of this,

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  scrub/unicrash.c |   13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> 
> diff --git a/scrub/unicrash.c b/scrub/unicrash.c
> index 0b5d1fa..10d7c14 100644
> --- a/scrub/unicrash.c
> +++ b/scrub/unicrash.c
> @@ -256,7 +256,6 @@ unicrash_complain(
>  	struct unicrash		*uc,
>  	const char		*descr,
>  	const char		*what,
> -	bool			normal,
>  	bool			unique,
>  	const char		*name,
>  	uint8_t			*uniname)
> @@ -267,10 +266,6 @@ unicrash_complain(
>  	bad1 = string_escape(name);
>  	bad2 = string_escape((char *)uniname);
>  
> -	if (!normal && should_warn_about_name(uc->ctx))
> -		str_info(uc->ctx, descr,
> -_("Unicode name \"%s\" in %s should be normalized as \"%s\"."),
> -				bad1, what, bad2);
>  	if (!unique)
>  		str_warn(uc->ctx, descr,
>  _("Duplicate normalized Unicode name \"%s\" found in %s."),
> @@ -342,20 +337,18 @@ __unicrash_check_name(
>  {
>  	uint8_t			uniname[(NAME_MAX * 2) + 1];
>  	bool			moveon;
> -	bool			normal;
>  	bool			unique;
>  
>  	memset(uniname, 0, (NAME_MAX * 2) + 1);
> -	normal = unicrash_normalize(name, uniname, NAME_MAX * 2);
> +	unicrash_normalize(name, uniname, NAME_MAX * 2);
>  	moveon = unicrash_add(uc, uniname, ino, &unique);
>  	if (!moveon)
>  		return false;
>  
> -	if (normal && unique)
> +	if (unique)
>  		return true;
>  
> -	unicrash_complain(uc, descr, namedescr, normal, unique, name,
> -			uniname);
> +	unicrash_complain(uc, descr, namedescr, unique, name, uniname);
>  	return true;
>  }
>  
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scrub/unicrash.c b/scrub/unicrash.c
index 0b5d1fa..10d7c14 100644
--- a/scrub/unicrash.c
+++ b/scrub/unicrash.c
@@ -256,7 +256,6 @@  unicrash_complain(
 	struct unicrash		*uc,
 	const char		*descr,
 	const char		*what,
-	bool			normal,
 	bool			unique,
 	const char		*name,
 	uint8_t			*uniname)
@@ -267,10 +266,6 @@  unicrash_complain(
 	bad1 = string_escape(name);
 	bad2 = string_escape((char *)uniname);
 
-	if (!normal && should_warn_about_name(uc->ctx))
-		str_info(uc->ctx, descr,
-_("Unicode name \"%s\" in %s should be normalized as \"%s\"."),
-				bad1, what, bad2);
 	if (!unique)
 		str_warn(uc->ctx, descr,
 _("Duplicate normalized Unicode name \"%s\" found in %s."),
@@ -342,20 +337,18 @@  __unicrash_check_name(
 {
 	uint8_t			uniname[(NAME_MAX * 2) + 1];
 	bool			moveon;
-	bool			normal;
 	bool			unique;
 
 	memset(uniname, 0, (NAME_MAX * 2) + 1);
-	normal = unicrash_normalize(name, uniname, NAME_MAX * 2);
+	unicrash_normalize(name, uniname, NAME_MAX * 2);
 	moveon = unicrash_add(uc, uniname, ino, &unique);
 	if (!moveon)
 		return false;
 
-	if (normal && unique)
+	if (unique)
 		return true;
 
-	unicrash_complain(uc, descr, namedescr, normal, unique, name,
-			uniname);
+	unicrash_complain(uc, descr, namedescr, unique, name, uniname);
 	return true;
 }