[PATCH 24/32] xfs: scrub shouldn't tag metadata files with attr forks if metadir and parent pointers are on

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <djwong@xxxxxxxxxx>

If metadata directory trees and parent pointers are both enabled, it's
ok for metadata files to have extended attribute forks.  Don't flag
these in online checking, and don't remove it during online repair.

Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx>
---
 fs/xfs/scrub/common.c |    8 ++++++--
 fs/xfs/scrub/repair.c |    8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)


diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
index fbc28bd98e957..5a6681c6647c3 100644
--- a/fs/xfs/scrub/common.c
+++ b/fs/xfs/scrub/common.c
@@ -1248,8 +1248,12 @@ xchk_metadata_inode_forks(
 		return 0;
 	}
 
-	/* They also should never have extended attributes. */
-	if (xfs_inode_hasattr(sc->ip)) {
+	/*
+	 * Metadata files can only have extended attributes if parent pointers
+	 * and the metadata directory tree are enabled.
+	 */
+	if (xfs_inode_hasattr(sc->ip) &&
+	    !(xfs_has_parent(sc->mp) && xfs_has_metadir(sc->mp))) {
 		xchk_ino_set_corrupt(sc, sc->ip->i_ino);
 		return 0;
 	}
diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
index b15eee680510c..12cbc14b24810 100644
--- a/fs/xfs/scrub/repair.c
+++ b/fs/xfs/scrub/repair.c
@@ -1100,8 +1100,12 @@ xrep_metadata_inode_forks(
 			return error;
 	}
 
-	/* Clear the attr forks since metadata shouldn't have that. */
-	if (xfs_inode_hasattr(sc->ip)) {
+	/*
+	 * Clear the attr forks since metadata shouldn't have one unless
+	 * parent pointers and the metadata directory tree are enabled.
+	 */
+	if (xfs_inode_hasattr(sc->ip) &&
+	    !(xfs_has_parent(sc->mp) && xfs_has_metadir(sc->mp))) {
 		if (!dirty) {
 			dirty = true;
 			xfs_trans_ijoin(sc->tp, sc->ip, 0);





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux