Skip to contentSkip to conversation

F2FS: Fix the logic of IS_DNODE()

PATCH In review Zhihui Zhang 2 participants 2 messages Apr 7, 2013 – Apr 8, 2013 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 F2FS: Fix the logic of IS_DNODE()

---
 fs/f2fs/node.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/node.h +1 -1
index afdb130..2be47b2 100644
@@ -239,7 +239,7 @@ static inline bool IS_DNODE(struct page *node_page)
 		return false;
 	if (ofs >= 6 + 2 * NIDS_PER_BLOCK) {
 		ofs -= 6 + 2 * NIDS_PER_BLOCK;
-		if ((long int)ofs % (NIDS_PER_BLOCK + 1))
+		if (!((long int)ofs % (NIDS_PER_BLOCK + 1)))
 			return false;
 	}
 	return true;
Signature · 1 line
1.7.9.5
#1 lore raw

Hi,

2013-04-07 (일), 12:57 -0400, Zhihui Zhang:

Quoted 10 lines
---
 fs/f2fs/node.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/node.h +0 -0
index afdb130..2be47b2 100644

fs/f2fs/node.h static inline bool IS_DNODE(struct page *node_page) · line 242

Quoted 5 lines
fs/f2fs/node.h +1 -1
@@ -239,7 +239,7 @@ static inline bool IS_DNODE(struct page *node_page)
 		return false;
 	if (ofs >= 6 + 2 * NIDS_PER_BLOCK) {
 		ofs -= 6 + 2 * NIDS_PER_BLOCK;
-		if ((long int)ofs % (NIDS_PER_BLOCK + 1))
+		if (!((long int)ofs % (NIDS_PER_BLOCK + 1)))

Great catch!
I'll apply this.
Thank you.

Quoted 3 lines
fs/f2fs/node.h +0 -0
 			return false;
 	}
 	return true;
Signature · 2 lines
Jaegeuk Kim
Samsung