]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Add repair code for propogating attr2 bit to secondary superblocks (ala attr1).
authorNathan Scott <nathans@sgi.com>
Thu, 29 Sep 2005 03:32:20 +0000 (03:32 +0000)
committerNathan Scott <nathans@sgi.com>
Thu, 29 Sep 2005 03:32:20 +0000 (03:32 +0000)
repair/versions.c
repair/versions.h
repair/xfs_repair.c

index c69b1e798693a8240f095eb06d5c1dab594cf200..9f7bdd6346639dcf6e62d9c57ded0d4f4f6b835c 100644 (file)
@@ -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)  {
index 2187c1c54869e0f0cc96db1a897172e4cb4757bd..bf8ac0d4a3c2e7b60e1cf8d0bf5408280252168e 100644 (file)
@@ -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;
index eba1ae2be825566507f8afe9535ee4b9b27ffcd0..1c39c6f746c136e94bf2d3b3ffe6e2e31667a3e4 100644 (file)
@@ -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;