[COVERITY] Fix dead code bug in mke2fs
If the fs_type is not specified and we are creating a journal device, to
use a fs_type of "journal"; this used to be the behavior before we added
support for the /etc/mke2fs.conf file, so let's fix it to restore the
old behavior.
Coverity ID: 4: Deadcode
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 2e72dca..f459a7c 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1272,7 +1272,10 @@
int megs = (__u64)fs_param.s_blocks_count *
(EXT2_BLOCK_SIZE(&fs_param) / 1024) / 1024;
- if (megs <= 3)
+ if (fs_param.s_feature_incompat &
+ EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)
+ fs_type = "journal";
+ else if (megs <= 3)
fs_type = "floppy";
else if (megs <= 512)
fs_type = "small";
@@ -1337,8 +1340,6 @@
if (fs_param.s_feature_incompat &
EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) {
- if (!fs_type)
- fs_type = "journal";
reserved_ratio = 0;
fs_param.s_feature_incompat = EXT3_FEATURE_INCOMPAT_JOURNAL_DEV;
fs_param.s_feature_compat = 0;