linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs_repair: fix incorrect dabtree hashval comparison
@ 2023-03-15  1:01 ` Darrick J. Wong
  2023-03-17 10:27   ` Carlos Maiolino
  0 siblings, 1 reply; 2+ messages in thread
From: Darrick J. Wong @ 2023-03-15  1:01 UTC (permalink / raw)
  To: cem; +Cc: linux-xfs

From: Darrick J. Wong <djwong@kernel.org>

If an xattr structure contains enough names with the same hash value to
fill multiple xattr leaf blocks with names all hashing to the same
value, then the dabtree nodes will contain consecutive entries with the
same hash value.

This causes false corruption reports in xfs_repair because it's not
expecting such a huge same-hashing structure.  Fix that.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 repair/da_util.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/repair/da_util.c b/repair/da_util.c
index 7239c2e2c64..b229422c81e 100644
--- a/repair/da_util.c
+++ b/repair/da_util.c
@@ -330,7 +330,7 @@ _("%s block used/count inconsistency - %d/%hu\n"),
 	/*
 	 * hash values monotonically increasing ???
 	 */
-	if (cursor->level[this_level].hashval >=
+	if (cursor->level[this_level].hashval >
 				be32_to_cpu(nodehdr.btree[entry].hashval)) {
 		do_warn(
 _("%s block hashvalue inconsistency, expected > %u / saw %u\n"),

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs_repair: fix incorrect dabtree hashval comparison
  2023-03-15  1:01 ` [PATCH] xfs_repair: fix incorrect dabtree hashval comparison Darrick J. Wong
@ 2023-03-17 10:27   ` Carlos Maiolino
  0 siblings, 0 replies; 2+ messages in thread
From: Carlos Maiolino @ 2023-03-17 10:27 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs

On Tue, Mar 14, 2023 at 06:01:55PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> If an xattr structure contains enough names with the same hash value to
> fill multiple xattr leaf blocks with names all hashing to the same
> value, then the dabtree nodes will contain consecutive entries with the
> same hash value.
> 
> This causes false corruption reports in xfs_repair because it's not
> expecting such a huge same-hashing structure.  Fix that.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>

Looks good. Will test.

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

> ---
>  repair/da_util.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/repair/da_util.c b/repair/da_util.c
> index 7239c2e2c64..b229422c81e 100644
> --- a/repair/da_util.c
> +++ b/repair/da_util.c
> @@ -330,7 +330,7 @@ _("%s block used/count inconsistency - %d/%hu\n"),
>  	/*
>  	 * hash values monotonically increasing ???
>  	 */
> -	if (cursor->level[this_level].hashval >=
> +	if (cursor->level[this_level].hashval >
>  				be32_to_cpu(nodehdr.btree[entry].hashval)) {
>  		do_warn(
>  _("%s block hashvalue inconsistency, expected > %u / saw %u\n"),

-- 
Carlos Maiolino

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-17 10:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <rLhelIA3PWFSu6pHHRNOAfQqN0ICDO3VHNd96FY5L8TPMWp_Xsd1EKrEIfXV-IcapJ6cjVFwKcqYsknuJHcFng==@protonmail.internalid>
2023-03-15  1:01 ` [PATCH] xfs_repair: fix incorrect dabtree hashval comparison Darrick J. Wong
2023-03-17 10:27   ` Carlos Maiolino

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).