summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorAndreas Dilger <adilger@whamcloud.com>2011-09-24 13:17:05 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-09-24 14:34:47 -0400
commitd90d6a71460d2e3fd57607f90f9abbd1e7d77e3b (patch)
treeeb0f6931fbdb12de524e7401931a04772abddc8e /misc
parent6b56f3d92d08806ab415e8fd883480f7f9c148e8 (diff)
downloade2fsprogs-d90d6a71460d2e3fd57607f90f9abbd1e7d77e3b.tar.gz
tune2fs: kill external journal if device not found
Continue to remove the external journal device even if the device cannot be found. Add a test to verify that the journal device/UUID are actually removed from the superblock. It isn't possible to use a real journal device for testing without loopback devices and such (it must be a block device) and this would invite complexity and failures in the regression test. Signed-off-by: Andreas Dilger <adilger@whamcloud.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'misc')
-rw-r--r--misc/tune2fs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 3e126971..d0d44c8a 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -184,7 +184,7 @@ static void remove_journal_device(ext2_filsys fs)
journal_path =
ext2fs_find_block_device(fs->super->s_journal_dev);
if (!journal_path)
- return;
+ goto no_valid_journal;
}
#ifdef CONFIG_TESTIO_DEBUG
@@ -251,7 +251,9 @@ static void remove_journal_device(ext2_filsys fs)
no_valid_journal:
if (commit_remove_journal == 0) {
- fputs(_("Journal NOT removed\n"), stderr);
+ fputs(_("Cannot locate journal device. It was NOT removed\n"
+ "Use -f option to remove missing journal device.\n"),
+ stderr);
exit(1);
}
fs->super->s_journal_dev = 0;