aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLukas Czerner <lczerner@redhat.com>2012-11-08 13:28:29 -0500
committerTheodore Ts'o <tytso@mit.edu>2012-11-08 13:28:29 -0500
commit79add3a3f795e688e35d5e703d5a8cfa8ef923ac (patch)
tree12805bed5dbe74f9eed349845bd6bb718673ea77 /fs
parentd8ec0c396083ef633a065629df1565246dbb2f33 (diff)
ext4: notify when discard is not supported
Notify user when mounting the file system with -o discard option, but the device does not support discard. Obviously we do not want to fail the mount or disable the options, because the underlying device might change in future even without file system remount. Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/super.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index ea21231633eb..6729470ee1a4 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4015,6 +4015,14 @@ no_journal:
4015 } 4015 }
4016#endif /* CONFIG_QUOTA */ 4016#endif /* CONFIG_QUOTA */
4017 4017
4018 if (test_opt(sb, DISCARD)) {
4019 struct request_queue *q = bdev_get_queue(sb->s_bdev);
4020 if (!blk_queue_discard(q))
4021 ext4_msg(sb, KERN_WARNING,
4022 "mounting with \"discard\" option, but "
4023 "the device does not support discard");
4024 }
4025
4018 ext4_msg(sb, KERN_INFO, "mounted filesystem with%s. " 4026 ext4_msg(sb, KERN_INFO, "mounted filesystem with%s. "
4019 "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, 4027 "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts,
4020 *sbi->s_es->s_mount_opts ? "; " : "", orig_data); 4028 *sbi->s_es->s_mount_opts ? "; " : "", orig_data);