From 9b1d68ec8e67891a32c54e68fd58be9e5defbaf1 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 29 Sep 2005 03:32:20 +0000 Subject: [PATCH] Add repair code for propogating attr2 bit to secondary superblocks (ala attr1). --- repair/versions.c | 27 +++++++++++++++++++++++++++ repair/versions.h | 2 ++ repair/xfs_repair.c | 1 + 3 files changed, 30 insertions(+) diff --git a/repair/versions.c b/repair/versions.c index c69b1e798..9f7bdd634 100644 --- a/repair/versions.c +++ b/repair/versions.c @@ -54,6 +54,14 @@ update_sb_version(xfs_mount_t *mp) } } + if (fs_attributes2) { + if (!XFS_SB_VERSION_HASATTR2(sb)) { + ASSERT(fs_attributes2_allowed); + + XFS_SB_VERSION_ADDATTR2(sb); + } + } + if (fs_inode_nlink) { if (!XFS_SB_VERSION_HASNLINK(sb)) { ASSERT(fs_inode_nlink_allowed); @@ -138,6 +146,7 @@ parse_sb_version(xfs_sb_t *sb) int issue_warning; fs_attributes = 0; + fs_attributes2 = 0; fs_inode_nlink = 0; fs_quotas = 0; fs_aligned_inodes = 0; @@ -221,6 +230,24 @@ _("WARNING: you have disallowed attributes but this filesystem\n" } } + if (XFS_SB_VERSION_HASATTR2(sb)) { + if (!fs_attributes2_allowed) { + if (!no_modify) { + do_warn( +_("WARNING: you have disallowed attr2 attributes but this filesystem\n" + "\thas attributes. The filesystem will be downgraded and\n" + "\tall attr2 attributes will be removed.\n")); + } else { + do_warn( +_("WARNING: you have disallowed attr2 attributes but this filesystem\n" + "\thas attributes. The filesystem would be downgraded and\n" + "\tall attr2 attributes would be removed.\n")); + } + } else { + fs_attributes2 = 1; + } + } + if (XFS_SB_VERSION_HASNLINK(sb)) { if (!fs_inode_nlink_allowed) { if (!no_modify) { diff --git a/repair/versions.h b/repair/versions.h index 2187c1c54..bf8ac0d4a 100644 --- a/repair/versions.h +++ b/repair/versions.h @@ -55,6 +55,7 @@ */ EXTERN int fs_attributes_allowed; +EXTERN int fs_attributes2_allowed; EXTERN int fs_inode_nlink_allowed; EXTERN int fs_quotas_allowed; EXTERN int fs_aligned_inodes_allowed; @@ -68,6 +69,7 @@ EXTERN int fs_shared_allowed; */ EXTERN int fs_attributes; +EXTERN int fs_attributes2; EXTERN int fs_inode_nlink; EXTERN int fs_quotas; EXTERN int fs_aligned_inodes; diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c index eba1ae2be..1c39c6f74 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -177,6 +177,7 @@ process_args(int argc, char **argv) sb_unit = 0; sb_width = 0; fs_attributes_allowed = 1; + fs_attributes2_allowed = 1; fs_inode_nlink_allowed = 1; fs_quotas_allowed = 1; fs_aligned_inodes_allowed = 1; -- 2.47.2