summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChenxi Mao2015-05-30 16:56:46 +0200
committerJaegeuk Kim2015-06-02 01:21:32 +0200
commit96c6dd59bf1d8b30afd3681550b321f4183e1914 (patch)
tree9237316bd1136839edceec4f253b31b5ed171dae /fs/f2fs
parentf2fs crypto: remove alloc_page for bounce_page (diff)
downloadkernel-qcow2-linux-96c6dd59bf1d8b30afd3681550b321f4183e1914.tar.gz
kernel-qcow2-linux-96c6dd59bf1d8b30afd3681550b321f4183e1914.tar.xz
kernel-qcow2-linux-96c6dd59bf1d8b30afd3681550b321f4183e1914.zip
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: Chenxi Mao <chenxi.mao2013@gmail.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/super.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 8b5f5fb8f5cb..f0be6a62120a 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1237,10 +1237,12 @@ try_onemore:
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;