summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2017-06-05 18:29:07 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2017-07-04 02:11:37 -0700
commitd9703d9097d7c97f735a3b7870c52735a4dfa051 (patch)
tree5cdfe1fba29116a6473ba2258d93aaf88daedb14 /fs/f2fs/segment.c
parent2a510c005c9d3fafbaae1a6d27da8256c95542f9 (diff)
downloadlinux-d9703d9097d7c97f735a3b7870c52735a4dfa051.tar.bz2
f2fs: add f2fs_bug_on in __remove_discard_cmd
Recently, discard related codes have changed a lot, so add f2fs_bug_on to detect potential bug. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r--fs/f2fs/segment.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 0fa717a47394..86a0c1095939 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -739,6 +739,8 @@ static void __remove_discard_cmd(struct f2fs_sb_info *sbi,
{
struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info;
+ f2fs_bug_on(sbi, dc->ref);
+
if (dc->error == -EOPNOTSUPP)
dc->error = 0;