Skip to contentSkip to conversation

f2fs: check if inmem_pages list is empty correctly

PATCH In review Sheng Yong 2 participants 2 messages Apr 17, 2018 F2FS file system

lore
Share & tools
lore

Sheng Yong

author
#0 lore raw

PATCH 1/1 f2fs: check if inmem_pages list is empty correctly

`cur' will never be NULL, we should check inmem_pages list instead.

---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/segment.c +1 -1
index 5854cc4e1d67..bf9dab55b370 100644
@@ -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);
 
Signature · 6 lines
2.14.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Sheng Yong

`cur' will never be NULL, we should check inmem_pages list instead.

Thanks,

Quoted 10 lines
---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/segment.c +0 -0
index 5854cc4e1d67..bf9dab55b370 100644

fs/f2fs/segment.c void drop_inmem_page(struct inode *inode, struct page *page) · line 334

Quoted 8 lines
fs/f2fs/segment.c +1 -1
@@ -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);
 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot