summaryrefslogtreecommitdiff
path: root/misc/tune2fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc/tune2fs.c')
-rw-r--r--misc/tune2fs.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 7d2d38d7..301cf388 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -1308,6 +1308,12 @@ mmp_error:
if (FEATURE_ON(E2P_FEATURE_RO_INCOMPAT,
EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
+ if (mount_flags & EXT2_MF_MOUNTED) {
+ fputs(_("Cannot enable uninit_bg on a mounted "
+ "filesystem!\n"), stderr);
+ exit(1);
+ }
+
/* Do not enable uninit_bg when metadata_csum enabled */
if (ext2fs_has_feature_metadata_csum(fs->super))
ext2fs_clear_feature_gdt_csum(fs->super);
@@ -1317,6 +1323,12 @@ mmp_error:
if (FEATURE_OFF(E2P_FEATURE_RO_INCOMPAT,
EXT4_FEATURE_RO_COMPAT_GDT_CSUM)) {
+ if (mount_flags & EXT2_MF_MOUNTED) {
+ fputs(_("Cannot disable uninit_bg on a mounted "
+ "filesystem!\n"), stderr);
+ exit(1);
+ }
+
err = disable_uninit_bg(fs,
EXT4_FEATURE_RO_COMPAT_GDT_CSUM);
if (err)