提交 96c6dd59 编写于 作者: C Chenxi Mao 提交者: Jaegeuk Kim

f2fs: disable the discard option when device doesn't support

Current f2fs check the whether the blk device can support discard.
However, the code will cause the discard option cannot be enabled.
Because the clear_opt(sbi, DISCARD) will be invoked forever.

This patch can fix this issue.

Jaegeuk Kim:
 The original patch was intended to disable the discard option when device
 does not support trim command.
 Rather than remaining the buggy patch, let's replace with this patch as
 an integrated one.
Signed-off-by: NChenxi Mao <chenxi.mao2013@gmail.com>
Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
上级 4683ff83
......@@ -1237,10 +1237,12 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
if (test_opt(sbi, DISCARD)) {
struct request_queue *q = bdev_get_queue(sb->s_bdev);
if (!blk_queue_discard(q))
if (!blk_queue_discard(q)) {
f2fs_msg(sb, KERN_WARNING,
"mounting with \"discard\" option, but "
"the device does not support discard");
clear_opt(sbi, DISCARD);
}
}
sbi->s_kobj.kset = f2fs_kset;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册