Linux XFS filesystem development
 help / color / mirror / Atom feed
* [PATCH v2] db: increase metadump's default overly long extent discard threshold
@ 2017-09-27  2:34 Darrick J. Wong
  2017-09-27 10:03 ` Carlos Maiolino
  0 siblings, 1 reply; 2+ messages in thread
From: Darrick J. Wong @ 2017-09-27  2:34 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs

Back in 88b8e1d6d7 ("Make xfs_metadump more robust against bad data"),
metadump grew the ability to ignore a directory extent if it was longer
than 20 blocks.  Presumably this was to protect metadump from dumping
absurdly long extents resulting from bmbt corruption, but it's certainly
possible to create a directory with an extent longer than 20 blocks.
Hilariously, the discards happen with no warning unless the caller
explicitly set -w.

This was raised to 1000 blocks in 7431d134fe8 ("Increase default maximum
extent size for xfs_metadump when copying..."), but it's still possible
to create a directory with an extent longer than 1000 blocks.

Increase the threshold to MAXEXTLEN blocks because it's totally valid
for the filesystem to create extents up to that length.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
v2: update manpage
---
 db/metadump.c           |    2 +-
 man/man8/xfs_metadump.8 |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/db/metadump.c b/db/metadump.c
index 6dd06c3..8ffb90f 100644
--- a/db/metadump.c
+++ b/db/metadump.c
@@ -32,7 +32,7 @@
 #include "field.h"
 #include "dir2.h"
 
-#define DEFAULT_MAX_EXT_SIZE	1000
+#define DEFAULT_MAX_EXT_SIZE	MAXEXTLEN
 
 /*
  * It's possible that multiple files in a directory (or attributes
diff --git a/man/man8/xfs_metadump.8 b/man/man8/xfs_metadump.8
index 3731d6a..b6af4b6 100644
--- a/man/man8/xfs_metadump.8
+++ b/man/man8/xfs_metadump.8
@@ -114,7 +114,7 @@ copied.
 .B \-m
 Set the maximum size of an allowed metadata extent.  Extremely large metadata
 extents are likely to be corrupt, and will be skipped if they exceed
-this value.  The default size is 1000 blocks.
+this value.  The default size is 2097151 blocks.
 .TP
 .B \-o
 Disables obfuscation of file names and extended attributes.

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

* Re: [PATCH v2] db: increase metadump's default overly long extent discard threshold
  2017-09-27  2:34 [PATCH v2] db: increase metadump's default overly long extent discard threshold Darrick J. Wong
@ 2017-09-27 10:03 ` Carlos Maiolino
  0 siblings, 0 replies; 2+ messages in thread
From: Carlos Maiolino @ 2017-09-27 10:03 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, xfs

On Wed, Sep 27, 2017 at 02:34:10AM +0000, Darrick J. Wong wrote:
> Back in 88b8e1d6d7 ("Make xfs_metadump more robust against bad data"),
> metadump grew the ability to ignore a directory extent if it was longer
> than 20 blocks.  Presumably this was to protect metadump from dumping
> absurdly long extents resulting from bmbt corruption, but it's certainly
> possible to create a directory with an extent longer than 20 blocks.
> Hilariously, the discards happen with no warning unless the caller
> explicitly set -w.
> 

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

> This was raised to 1000 blocks in 7431d134fe8 ("Increase default maximum
> extent size for xfs_metadump when copying..."), but it's still possible
> to create a directory with an extent longer than 1000 blocks.
> 
> Increase the threshold to MAXEXTLEN blocks because it's totally valid
> for the filesystem to create extents up to that length.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> v2: update manpage
> ---
>  db/metadump.c           |    2 +-
>  man/man8/xfs_metadump.8 |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/db/metadump.c b/db/metadump.c
> index 6dd06c3..8ffb90f 100644
> --- a/db/metadump.c
> +++ b/db/metadump.c
> @@ -32,7 +32,7 @@
>  #include "field.h"
>  #include "dir2.h"
>  
> -#define DEFAULT_MAX_EXT_SIZE	1000
> +#define DEFAULT_MAX_EXT_SIZE	MAXEXTLEN
>  
>  /*
>   * It's possible that multiple files in a directory (or attributes
> diff --git a/man/man8/xfs_metadump.8 b/man/man8/xfs_metadump.8
> index 3731d6a..b6af4b6 100644
> --- a/man/man8/xfs_metadump.8
> +++ b/man/man8/xfs_metadump.8
> @@ -114,7 +114,7 @@ copied.
>  .B \-m
>  Set the maximum size of an allowed metadata extent.  Extremely large metadata
>  extents are likely to be corrupt, and will be skipped if they exceed
> -this value.  The default size is 1000 blocks.
> +this value.  The default size is 2097151 blocks.
>  .TP
>  .B \-o
>  Disables obfuscation of file names and extended attributes.
> --
> 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

-- 
Carlos

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

end of thread, other threads:[~2017-09-27 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-27  2:34 [PATCH v2] db: increase metadump's default overly long extent discard threshold Darrick J. Wong
2017-09-27 10:03 ` Carlos Maiolino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox