summaryrefslogtreecommitdiff
path: root/ext4_utils/make_ext4fs.c
diff options
context:
space:
mode:
authorEric Miao <emiao@nvidia.com>2015-04-16 15:00:11 -0700
committerEric Miao <emiao@nvidia.com>2015-04-28 16:49:14 -0700
commitaaf32ea5166b6b86023dc283311228cdebb3dc02 (patch)
tree436cb76db77729fb36170b153972c02454ea2346 /ext4_utils/make_ext4fs.c
parent249518de7cb7ddb1c066b3bb8b10bc0f66222f7d (diff)
downloadextras-aaf32ea5166b6b86023dc283311228cdebb3dc02.tar.gz
make_ext4fs: write out super blocks at last for block devices
Change-Id: I93ee37a649aabff14464030efd88f79e1ae324f0 Signed-off-by: Eric Miao <emiao@nvidia.com>
Diffstat (limited to 'ext4_utils/make_ext4fs.c')
-rw-r--r--ext4_utils/make_ext4fs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index 5c9e2085..5bb1872c 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -503,6 +503,13 @@ int make_ext4fs_internal(int fd, const char *_directory,
if (setjmp(setjmp_env))
return EXIT_FAILURE; /* Handle a call to longjmp() */
+ info.block_device = is_block_device_fd(fd);
+
+ if (info.block_device && (sparse || gzip || crc)) {
+ fprintf(stderr, "No sparse/gzip/crc allowed for block device\n");
+ return EXIT_FAILURE;
+ }
+
if (_mountpoint == NULL) {
mountpoint = strdup("");
} else {
@@ -629,8 +636,6 @@ int make_ext4fs_internal(int fd, const char *_directory,
ext4_update_free();
- ext4_queue_sb();
-
if (block_list_file) {
size_t dirlen = directory ? strlen(directory) : 0;
struct block_allocation* p = get_saved_allocation_chain();