Commit f562146a authored by Namjae Jeon's avatar Namjae Jeon Committed by Linus Torvalds

fat: notify when discard is not supported

Change fatfs so that a warning is emitted when an attempt is made to mount
a filesystem with the unsupported `discard' option.

ext4 aready does this: http://patchwork.ozlabs.org/patch/192668/Signed-off-by: default avatarNamjae Jeon <linkinjeon@gmail.com>
Signed-off-by: default avatarAmit Sahrawat <amit.sahrawat83@gmail.com>
Acked-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6920d996
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/writeback.h> #include <linux/writeback.h>
#include <linux/log2.h> #include <linux/log2.h>
#include <linux/hash.h> #include <linux/hash.h>
#include <linux/blkdev.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include "fat.h" #include "fat.h"
...@@ -1431,6 +1432,14 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat, ...@@ -1431,6 +1432,14 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
goto out_fail; goto out_fail;
} }
if (sbi->options.discard) {
struct request_queue *q = bdev_get_queue(sb->s_bdev);
if (!blk_queue_discard(q))
fat_msg(sb, KERN_WARNING,
"mounting with \"discard\" option, but "
"the device does not support discard");
}
return 0; return 0;
out_invalid: out_invalid:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment