From: Sheng Yong Date: Tue, 17 Apr 2018 09:12:27 +0000 (+0800) Subject: f2fs: check if inmem_pages list is empty correctly X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d0891e84e1e61938aa8a3b75cb10a34769de022a;p=openwrt%2Fstaging%2Fblogic.git f2fs: check if inmem_pages list is empty correctly `cur' will never be NULL, we should check inmem_pages list instead. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index e22911f2a378..33d33db15d2f 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -328,7 +328,7 @@ void drop_inmem_page(struct inode *inode, struct page *page) break; } - f2fs_bug_on(sbi, !cur || cur->page != page); + f2fs_bug_on(sbi, list_empty(head) || cur->page != page); list_del(&cur->list); mutex_unlock(&fi->inmem_lock);