]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libext2fs: reserve the error code EXT2_ET_NO_GDESC
authorTheodore Ts'o <tytso@mit.edu>
Thu, 16 Jan 2020 20:35:29 +0000 (15:35 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 16 Jan 2020 20:35:29 +0000 (15:35 -0500)
This is really only needed in the 1.46+ where the EXT2_FLAG_SUPER_ONLY
is honored by ext2fs_open to only read the superblock, so that
fs->group_desc can be NULL.  We define it in the maint branch so that
we can be sure the error tables are kept in sync (in the unlikely case
that a new error code needs to be assigned in the maint branch).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/ext2_err.et.in
lib/ext2fs/imager.c

index b2ba71ad2fd594d05b42f982f386c588a6cc6c8d..0c76fee6424862375e9c293c2f2c2c5972907b5a 100644 (file)
@@ -545,4 +545,7 @@ ec  EXT2_ET_INODE_CORRUPTED,
 ec     EXT2_ET_EA_INODE_CORRUPTED,
        "Inode containing extended attribute value is corrupted"
 
+ec     EXT2_ET_NO_GDESC,
+       "Group descriptors not loaded"
+
        end
index 7fd06f7434bd67b1d103714cc952a3fd1c7f837a..20bb99aea999b35dde0d4a7ff6796f74153c450b 100644 (file)
@@ -201,6 +201,9 @@ errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd,
        int             j;
 #endif
 
+       if (fs->group_desc == NULL)
+               return EXT2_ET_NO_GDESC;
+
        buf = malloc(fs->blocksize);
        if (!buf)
                return ENOMEM;