diff --git a/fs/ext4/super.c b/fs/ext4/super.c index ea21231633eb0dcaf1a5c7045afc7f19affa06b0..6729470ee1a418f793961df5de781403f2917d28 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4015,6 +4015,14 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) } #endif /* CONFIG_QUOTA */ + if (test_opt(sb, DISCARD)) { + struct request_queue *q = bdev_get_queue(sb->s_bdev); + if (!blk_queue_discard(q)) + ext4_msg(sb, KERN_WARNING, + "mounting with \"discard\" option, but " + "the device does not support discard"); + } + ext4_msg(sb, KERN_INFO, "mounted filesystem with%s. " "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data);