* [PATCH] ext4: clarify error messages for mounting fs w/o journal /w journal options
@ 2016-02-12 13:31 Georg Altmann
2016-02-12 17:03 ` Theodore Ts'o
0 siblings, 1 reply; 3+ messages in thread
From: Georg Altmann @ 2016-02-12 13:31 UTC (permalink / raw)
To: tytso; +Cc: adilger.kernel, linux-ext4, linux-kernel, Georg Altmann
Previous message was hard to understand: When mounting a ext4 fs without a
journal, but a mount option that controls journaling is used, clearly state
that the fs cannot be mounted with this option because it has no journal.
See also comments at
https://bugs.archlinux.org/task/48135
Signed-off-by: Georg Altmann <george@george-net.de>
---
fs/ext4/super.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 486e869..4c50f0d 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3716,25 +3716,25 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
} else {
/* Nojournal mode, all journal mount options are illegal */
if (test_opt2(sb, EXPLICIT_JOURNAL_CHECKSUM)) {
- ext4_msg(sb, KERN_ERR, "can't mount with "
- "journal_checksum, fs mounted w/o journal");
+ ext4_msg(sb, KERN_ERR, "can't mount with option "
+ "journal_checksum, fs has no journal");
goto failed_mount_wq;
}
if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) {
- ext4_msg(sb, KERN_ERR, "can't mount with "
- "journal_async_commit, fs mounted w/o journal");
+ ext4_msg(sb, KERN_ERR, "can't mount with option "
+ "journal_async_commit, fs has no journal");
goto failed_mount_wq;
}
if (sbi->s_commit_interval != JBD2_DEFAULT_MAX_COMMIT_AGE*HZ) {
- ext4_msg(sb, KERN_ERR, "can't mount with "
- "commit=%lu, fs mounted w/o journal",
+ ext4_msg(sb, KERN_ERR, "can't mount with option "
+ "commit=%lu, fs has no journal",
sbi->s_commit_interval / HZ);
goto failed_mount_wq;
}
if (EXT4_MOUNT_DATA_FLAGS &
(sbi->s_mount_opt ^ sbi->s_def_mount_opt)) {
- ext4_msg(sb, KERN_ERR, "can't mount with "
- "data=, fs mounted w/o journal");
+ ext4_msg(sb, KERN_ERR, "can't mount with option "
+ "data=, fs has no journal");
goto failed_mount_wq;
}
sbi->s_def_mount_opt &= EXT4_MOUNT_JOURNAL_CHECKSUM;
--
2.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: clarify error messages for mounting fs w/o journal /w journal options
2016-02-12 13:31 [PATCH] ext4: clarify error messages for mounting fs w/o journal /w journal options Georg Altmann
@ 2016-02-12 17:03 ` Theodore Ts'o
2016-02-12 17:32 ` Georg Altmann
0 siblings, 1 reply; 3+ messages in thread
From: Theodore Ts'o @ 2016-02-12 17:03 UTC (permalink / raw)
To: Georg Altmann; +Cc: adilger.kernel, linux-ext4, linux-kernel
On Fri, Feb 12, 2016 at 02:31:49PM +0100, Georg Altmann wrote:
> Previous message was hard to understand: When mounting a ext4 fs without a
> journal, but a mount option that controls journaling is used, clearly state
> that the fs cannot be mounted with this option because it has no journal.
Well, technically it's possible for the file system to have a journal,
but for journalling not to be enabled. For example:
root@kvm-xfstests:~# dmesg -n 7
root@kvm-xfstests:~# mke2fs -t ext4 -Fq /dev/vdc
/dev/vdc contains a ext4 file system
created on Fri Feb 12 11:59:10 2016
root@kvm-xfstests:~# dumpe2fs /dev/vdc | grep features
dumpe2fs 1.43-WIP (18-May-2015)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum
Journal features: (none)
root@kvm-xfstests:~# mount -o noload,commit=1 /dev/vdc /vdc 2> /dev/null
[ 313.867505] EXT4-fs (vdc): can't mount with commit=1, fs mounted w/o journal
So saying "fs has no journal" isn't necessarily going to be correct.
Maybe "Can't mount with data=xxx, journalling not enabled" would be
less confusing to users?
Cheers,
- Ted
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: clarify error messages for mounting fs w/o journal /w journal options
2016-02-12 17:03 ` Theodore Ts'o
@ 2016-02-12 17:32 ` Georg Altmann
0 siblings, 0 replies; 3+ messages in thread
From: Georg Altmann @ 2016-02-12 17:32 UTC (permalink / raw)
Cc: adilger.kernel, linux-ext4, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2135 bytes --]
Am 12.02.2016 um 18:03 schrieb Theodore Ts'o:
> On Fri, Feb 12, 2016 at 02:31:49PM +0100, Georg Altmann wrote:
>> Previous message was hard to understand: When mounting a ext4 fs without a
>> journal, but a mount option that controls journaling is used, clearly state
>> that the fs cannot be mounted with this option because it has no journal.
>
> Well, technically it's possible for the file system to have a journal,
> but for journalling not to be enabled. For example:
>
> root@kvm-xfstests:~# dmesg -n 7
> root@kvm-xfstests:~# mke2fs -t ext4 -Fq /dev/vdc
> /dev/vdc contains a ext4 file system
> created on Fri Feb 12 11:59:10 2016
> root@kvm-xfstests:~# dumpe2fs /dev/vdc | grep features
> dumpe2fs 1.43-WIP (18-May-2015)
> Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum
> Journal features: (none)
> root@kvm-xfstests:~# mount -o noload,commit=1 /dev/vdc /vdc 2> /dev/null
> [ 313.867505] EXT4-fs (vdc): can't mount with commit=1, fs mounted w/o journal
>
> So saying "fs has no journal" isn't necessarily going to be correct.
> Maybe "Can't mount with data=xxx, journalling not enabled" would be
> less confusing to users?
Yes.
I do not understand the error checking logic here enough:
it could be either fs without journal or journal not enabled, right?
So how about
"can't mount with data=xxx, journalling not enabled or no journal"
?
Or, if this can be justified in regard of code complexity, handle both
cases separately. Even nicer diagnostics for the user...
Should I send a new patch?
Regards,
Georg
--
PGP-Key: 0x1E320E65
D150 7783 A0D1 7507 1266 C5B3 BBF1 9C42 1E32 0E65
I don't like the idea of secret agencies to analyse and archive
personal communication. GnuPG is available as open source, free as as in
freedom, as a countermeasure. I use http://www.enigmail.net/ for Mozilla
Thunderbird. If you can, please use a frontend of your choice to send me
encrypted e-mail. See http://www.gnupg.org/ for an overview.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-12 17:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-12 13:31 [PATCH] ext4: clarify error messages for mounting fs w/o journal /w journal options Georg Altmann
2016-02-12 17:03 ` Theodore Ts'o
2016-02-12 17:32 ` Georg Altmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).