Blame SOURCES/xfsprogs-4.14.0-db-increase-metadump-s-default-overly-long-extent-di.patch

4af5d6
From 921c30674e9bc719e7c2747deb6deb04be2adb4b Mon Sep 17 00:00:00 2001
4af5d6
From: "Darrick J. Wong" <darrick.wong@oracle.com>
4af5d6
Date: Thu, 9 Nov 2017 11:35:22 -0600
4af5d6
Subject: [PATCH] db: increase metadump's default overly long extent discard 
4af5d6
 threshold
4af5d6
4af5d6
Back in 88b8e1d6d7 ("Make xfs_metadump more robust against bad data"),
4af5d6
metadump grew the ability to ignore a directory extent if it was longer
4af5d6
than 20 blocks.  Presumably this was to protect metadump from dumping
4af5d6
absurdly long extents resulting from bmbt corruption, but it's certainly
4af5d6
possible to create a directory with an extent longer than 20 blocks.
4af5d6
Hilariously, the discards happen with no warning unless the caller
4af5d6
explicitly set -w.
4af5d6
4af5d6
This was raised to 1000 blocks in 7431d134fe8 ("Increase default maximum
4af5d6
extent size for xfs_metadump when copying..."), but it's still possible
4af5d6
to create a directory with an extent longer than 1000 blocks.
4af5d6
4af5d6
Increase the threshold to MAXEXTLEN blocks because it's totally valid
4af5d6
for the filesystem to create extents up to that length.
4af5d6
4af5d6
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
4af5d6
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
4af5d6
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
4af5d6
---
4af5d6
 db/metadump.c           | 2 +-
4af5d6
 man/man8/xfs_metadump.8 | 2 +-
4af5d6
 2 files changed, 2 insertions(+), 2 deletions(-)
4af5d6
4af5d6
Index: xfsprogs-4.5.0/db/metadump.c
4af5d6
===================================================================
4af5d6
--- xfsprogs-4.5.0.orig/db/metadump.c
4af5d6
+++ xfsprogs-4.5.0/db/metadump.c
4af5d6
@@ -32,7 +32,7 @@
4af5d6
 #include "field.h"
4af5d6
 #include "dir2.h"
4af5d6
 
4af5d6
-#define DEFAULT_MAX_EXT_SIZE	1000
4af5d6
+#define DEFAULT_MAX_EXT_SIZE	MAXEXTLEN
4af5d6
 
4af5d6
 /*
4af5d6
  * It's possible that multiple files in a directory (or attributes
4af5d6
Index: xfsprogs-4.5.0/man/man8/xfs_metadump.8
4af5d6
===================================================================
4af5d6
--- xfsprogs-4.5.0.orig/man/man8/xfs_metadump.8
4af5d6
+++ xfsprogs-4.5.0/man/man8/xfs_metadump.8
4af5d6
@@ -114,7 +114,7 @@ copied.
4af5d6
 .B \-m
4af5d6
 Set the maximum size of an allowed metadata extent.  Extremely large metadata
4af5d6
 extents are likely to be corrupt, and will be skipped if they exceed
4af5d6
-this value.  The default size is 1000 blocks.
4af5d6
+this value.  The default size is 2097151 blocks.
4af5d6
 .TP
4af5d6
 .B \-o
4af5d6
 Disables obfuscation of file names and extended attributes.