summaryrefslogtreecommitdiff
path: root/ext4_utils/make_ext4fs_main.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2013-02-04 00:44:55 -0800
committerColin Cross <ccross@android.com>2013-02-04 15:33:50 -0800
commit56497f28bd20001dd5f931208e8d948cf2f81b2f (patch)
tree00a35e7640dd9b44d6a63fc86633ae7eb8d05cec /ext4_utils/make_ext4fs_main.c
parent682a27cbce4935a6598c42a248855eb5878c1115 (diff)
downloadextras-56497f28bd20001dd5f931208e8d948cf2f81b2f.tar.gz
ext4_utils: mark uninitialized inode tables in block groups
Block groups that have no used inodes have their inode table left uninitialized, unless -t is specified, in which case they are explicitly zeroed. When they are uninitialized, writing a sparse ext4 image over existing data can cause e2fsck to confuse the uninitialized data for lost inodes. Set the EXT4_BG_INODE_UNINIT flags on block groups that have no used inodes. This flag requires the block group checksum feature to be enabled, so also enable the checksum feature in the superblock and compute the checksum for the block group. Since zeroing the inode tables is now useless, remove the code for it and deprecate the -t command line option. Change-Id: I4927c1d866d051547cf0dadc8c8703ded0163925
Diffstat (limited to 'ext4_utils/make_ext4fs_main.c')
-rw-r--r--ext4_utils/make_ext4fs_main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext4_utils/make_ext4fs_main.c b/ext4_utils/make_ext4fs_main.c
index 739c4a16..b6c740d2 100644
--- a/ext4_utils/make_ext4fs_main.c
+++ b/ext4_utils/make_ext4fs_main.c
@@ -53,7 +53,7 @@ static void usage(char *path)
fprintf(stderr, " [ -g <blocks per group> ] [ -i <inodes> ] [ -I <inode size> ]\n");
fprintf(stderr, " [ -L <label> ] [ -f ] [ -a <android mountpoint> ]\n");
fprintf(stderr, " [ -S file_contexts ]\n");
- fprintf(stderr, " [ -z | -s ] [ -t ] [ -w ] [ -c ] [ -J ] [ -v ]\n");
+ fprintf(stderr, " [ -z | -s ] [ -w ] [ -c ] [ -J ] [ -v ]\n");
fprintf(stderr, " <filename> [<directory>]\n");
}
@@ -68,7 +68,6 @@ int main(int argc, char **argv)
int sparse = 0;
int crc = 0;
int wipe = 0;
- int init_itabs = 0;
int fd;
int exitcode;
int verbose = 0;
@@ -129,7 +128,7 @@ int main(int argc, char **argv)
sparse = 1;
break;
case 't':
- init_itabs = 1;
+ fprintf(stderr, "Warning: -t (initialize inode tables) is deprecated\n");
break;
case 'S':
#ifndef USE_MINGW
@@ -202,7 +201,7 @@ int main(int argc, char **argv)
}
exitcode = make_ext4fs_internal(fd, directory, mountpoint, fs_config_func, gzip,
- sparse, crc, wipe, init_itabs, sehnd, verbose);
+ sparse, crc, wipe, sehnd, verbose);
close(fd);
return exitcode;