aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Sarna <p.sarna@partner.samsung.com>2013-08-08 23:02:24 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-15 01:59:09 -0400
commitc4fa10098c869072e96cca0f372b37d30fa10be2 (patch)
treed12d5794f64776ea36521c451be2f052a604fff4
parent1929c51fc204bf84c5cbbd08861dd0a9da86b921 (diff)
ext4: fix mount/remount error messages for incompatible mount options
commit 6ae6514b33f941d3386da0dfbe2942766eab1577 upstream. Commit 5688978 ("ext4: improve handling of conflicting mount options") introduced incorrect messages shown while choosing wrong mount options. First of all, both cases of incorrect mount options, "data=journal,delalloc" and "data=journal,dioread_nolock" result in the same error message. Secondly, the problem above isn't solved for remount option: the mismatched parameter is simply ignored. Moreover, ext4_msg states that remount with options "data=journal,delalloc" succeeded, which is not true. To fix it up, I added a simple check after parse_options() call to ensure that data=journal and delalloc/dioread_nolock parameters are not present at the same time. Signed-off-by: Piotr Sarna <p.sarna@partner.samsung.com> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/ext4/super.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 3c2bf0c4c1e0..3f7c39e6d097 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3445,7 +3445,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
3445 } 3445 }
3446 if (test_opt(sb, DIOREAD_NOLOCK)) { 3446 if (test_opt(sb, DIOREAD_NOLOCK)) {
3447 ext4_msg(sb, KERN_ERR, "can't mount with " 3447 ext4_msg(sb, KERN_ERR, "can't mount with "
3448 "both data=journal and delalloc"); 3448 "both data=journal and dioread_nolock");
3449 goto failed_mount; 3449 goto failed_mount;
3450 } 3450 }
3451 if (test_opt(sb, DELALLOC)) 3451 if (test_opt(sb, DELALLOC))
@@ -4646,6 +4646,21 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
4646 goto restore_opts; 4646 goto restore_opts;
4647 } 4647 }
4648 4648
4649 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
4650 if (test_opt2(sb, EXPLICIT_DELALLOC)) {
4651 ext4_msg(sb, KERN_ERR, "can't mount with "
4652 "both data=journal and delalloc");
4653 err = -EINVAL;
4654 goto restore_opts;
4655 }
4656 if (test_opt(sb, DIOREAD_NOLOCK)) {
4657 ext4_msg(sb, KERN_ERR, "can't mount with "
4658 "both data=journal and dioread_nolock");
4659 err = -EINVAL;
4660 goto restore_opts;
4661 }
4662 }
4663
4649 if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED) 4664 if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED)
4650 ext4_abort(sb, "Abort forced by user"); 4665 ext4_abort(sb, "Abort forced by user");
4651 4666