]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
resize2fs: moving xattr inodes is not supported
authorTahsin Erdogan <tahsin@google.com>
Wed, 5 Jul 2017 03:53:59 +0000 (23:53 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 5 Jul 2017 03:53:59 +0000 (23:53 -0400)
In some cases, resize2fs needs to move inodes because their inode
number is greater than the maximum allowed. Moving extended attribute
inodes would require updating all the references to them. This
is currently not supported.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/ext2_err.et.in
resize/resize2fs.c

index ac96964d93d028b5083f5694124502f601daf18f..c5a9ffcc420ccead719ffe2dc0f570348fb71227 100644 (file)
@@ -542,4 +542,7 @@ ec  EXT2_ET_CORRUPT_JOURNAL_SB,
 ec     EXT2_ET_INODE_CORRUPTED,
        "Inode is corrupted"
 
+ec     EXT2_ET_CANNOT_MOVE_EA_INODE,
+       "Cannot move extended attribute inode"
+
        end
index 8f6d95e76dc8632890c9b6e4aea0ac4ca13902b1..a54564f08ae5f8ac1e5aaf3214e96ea83cc9b856 100644 (file)
@@ -2057,6 +2057,15 @@ static errcode_t inode_scan_and_fix(ext2_resize_t rfs)
                if (ino <= start_to_move)
                        goto remap_blocks; /* Don't need to move inode. */
 
+               /*
+                * Moving an extended attribute inode requires updating all inodes
+                * that reference it which is a lot more involved.
+                */
+               if (inode->i_flags & EXT4_EA_INODE_FL) {
+                       retval = EXT2_ET_CANNOT_MOVE_EA_INODE;
+                       goto errout;
+               }
+
                /*
                 * Find a new inode.  Now that extents and directory blocks
                 * are tied to the inode number through the checksum, we must