Skip to contentSkip to conversation

UBIFS: change | to & in assertion

PATCH Applied Dan Carpenter 2 participants 2 messages Jun 9, 2012 – Jun 18, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 UBIFS: change | to & in assertion

The asserts here never check anything because it uses '|' instead of '&'. Now if the flags are not set it prints a warning a a stack trace.

---
Static checker stuff. I have not tested this and it really does need to be tested.

fs/ubifs/find.c +2 -2
index 2559d17..28ec13a 100644
@@ -939,8 +939,8 @@ static int find_dirtiest_idx_leb(struct ubifs_info *c)
 	}
 	dbg_find("LEB %d, dirty %d and free %d flags %#x", lp->lnum, lp->dirty,
 		 lp->free, lp->flags);
-	ubifs_assert(lp->flags | LPROPS_TAKEN);
-	ubifs_assert(lp->flags | LPROPS_INDEX);
+	ubifs_assert(lp->flags & LPROPS_TAKEN);
+	ubifs_assert(lp->flags & LPROPS_INDEX);
 	return lnum;
 }
 
#1 lore raw
Quoted 4 lines · Dan Carpenter

The asserts here never check anything because it uses '|' instead of '&'. Now if the flags are not set it prints a warning a a stack trace.

Pushed to linux-ubifs.git, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy