exfat: Fix discard support
authorPali Rohár <pali@kernel.org>
Tue, 17 Mar 2020 21:46:52 +0000 (22:46 +0100)
committerNamjae Jeon <namjae.jeon@samsung.com>
Wed, 22 Apr 2020 11:14:05 +0000 (20:14 +0900)
Discard support was always unconditionally disabled. Now it is disabled
only in the case when blk_queue_discard() returns false.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
fs/exfat/super.c

index 16ed202ef5279abc40b23d03cd346b4baf4c23d3..30e914ad17b59643bb9ad99beb7868a79659dcee 100644 (file)
@@ -531,10 +531,11 @@ static int exfat_fill_super(struct super_block *sb, struct fs_context *fc)
        if (opts->discard) {
                struct request_queue *q = bdev_get_queue(sb->s_bdev);
 
-               if (!blk_queue_discard(q))
+               if (!blk_queue_discard(q)) {
                        exfat_msg(sb, KERN_WARNING,
                                "mounting with \"discard\" option, but the device does not support discard");
-               opts->discard = 0;
+                       opts->discard = 0;
+               }
        }
 
        sb->s_flags |= SB_NODIRATIME;