提交 d3ee456d 编写于 作者: N Namjae Jeon 提交者: Jaegeuk Kim

f2fs: notify when discard is not supported

Change f2fs so that a warning is emitted when an attempt is made to
mount a filesystem with the unsupported discard option.
Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: NAmit Sahrawat <a.sahrawat@samsung.com>
Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
上级 ae51fb31
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/random.h> #include <linux/random.h>
#include <linux/exportfs.h> #include <linux/exportfs.h>
#include <linux/blkdev.h>
#include <linux/f2fs_fs.h> #include <linux/f2fs_fs.h>
#include "f2fs.h" #include "f2fs.h"
...@@ -650,6 +651,14 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -650,6 +651,14 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
if (err) if (err)
goto fail; goto fail;
if (test_opt(sbi, DISCARD)) {
struct request_queue *q = bdev_get_queue(sb->s_bdev);
if (!blk_queue_discard(q))
f2fs_msg(sb, KERN_WARNING,
"mounting with \"discard\" option, but "
"the device does not support discard");
}
return 0; return 0;
fail: fail:
stop_gc_thread(sbi); stop_gc_thread(sbi);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册