Skip to contentSkip to conversation

db: increase metadump's default overly long extent discard threshold

PATCH Superseded Darrick J. Wong 2 participants 3 messages Sep 27, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 db: increase metadump's default overly long extent discard threshold

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.

---
 db/metadump.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
db/metadump.c +1 -1
index c179480..c8eb8f0 100644
@@ -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
#1 lore raw
Quoted 8 lines · Darrick J. Wong

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.

Quoted 8 lines

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.

This is documented in the manpage as being 1000, so that needs an update as well.

And should the warning be made unconditional, if that's what burned you?

-Eric

Quoted 18 lines
---
 db/metadump.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
db/metadump.c +1 -1
index c179480..c8eb8f0 100644
@@ -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
#2 lore raw
Quoted 13 lines · Eric Sandeen
Quoted 12 lines · Darrick J. Wong

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.

Quoted 7 lines
Quoted 4 lines

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

This is documented in the manpage as being 1000, so that needs an update as well.

Ok.

Quoted 2 lines

And should the warning be made unconditional, if that's what burned you?

Nah, since most of the other warnings in metadump are about things that look like bad metadata.

--D

Quoted 26 lines

-Eric

Quoted 10 lines
---
 db/metadump.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
db/metadump.c +0 -0
index c179480..c8eb8f0 100644

db/metadump.c line 38

Quoted 8 lines
db/metadump.c +1 -1
@@ -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

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