diff options
author | Brian Behlendorf <behlendorf1@llnl.gov> | 2007-03-19 08:25:38 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2007-03-19 08:25:38 -0400 |
commit | e066150a7034d39aaa8a65a280911e2ef8b3d48c (patch) | |
tree | fab6785144d41357c322030c0c6b39011131d45b /misc/mke2fs.c | |
parent | d90be5b1437b839e5f1afcee7073798d833e4534 (diff) | |
download | e2fsprogs-e066150a7034d39aaa8a65a280911e2ef8b3d48c.tar.gz |
[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>
Diffstat (limited to 'misc/mke2fs.c')
-rw-r--r-- | misc/mke2fs.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 2e72dcab..f459a7cf 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -1272,7 +1272,10 @@ static void PRS(int argc, char *argv[]) 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 @@ static void PRS(int argc, char *argv[]) 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; |