aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2021-01-21 17:08:40 -0500
committerTheodore Ts'o <tytso@mit.edu>2021-01-21 17:08:40 -0500
commitf8049f9fd7a5f678ced06e5272385fbf9d7125f3 (patch)
treef4887e24d48098071b7d39d9fc9db2633f13cd49
parentf84fed462a64fa680a8c89d1e248564dda981bf4 (diff)
downloade2fsprogs-f8049f9fd7a5f678ced06e5272385fbf9d7125f3.tar.gz
tune2fs: abort clearing the dir_index when the fs needs to be fsck'ed first
We were not checking the return value of check_fsck_needed() when checking to clear the dir_index feature. As a result, tune2fs would print that the file system needed to be checked first, but then go ahead and clear the dir_index flag. Addresses-Coverity-Bug: 1467671 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--misc/tune2fs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 7c9baf105..f3bfb0472 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -1238,9 +1238,10 @@ mmp_error:
if (FEATURE_OFF(E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_DIR_INDEX) &&
ext2fs_has_feature_metadata_csum(sb)) {
- check_fsck_needed(fs,
+ if (check_fsck_needed(fs,
_("Disabling directory index on filesystem with "
- "checksums could take some time."));
+ "checksums could take some time.")))
+ return 1;
if (mount_flags & EXT2_MF_MOUNTED) {
fputs(_("Cannot disable dir_index on a mounted "
"filesystem!\n"), stderr);