* [patch] UBIFS: change | to & in assertion
@ 2012-06-09 9:08 Dan Carpenter
2012-06-18 11:20 ` Artem Bityutskiy
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-06-09 9:08 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: kernel-janitors, linux-mtd, Adrian Hunter
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.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Static checker stuff. I have not tested this and it really does need to
be tested.
diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c
index 2559d17..28ec13a 100644
--- a/fs/ubifs/find.c
+++ b/fs/ubifs/find.c
@@ -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;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] UBIFS: change | to & in assertion
2012-06-09 9:08 [patch] UBIFS: change | to & in assertion Dan Carpenter
@ 2012-06-18 11:20 ` Artem Bityutskiy
0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2012-06-18 11:20 UTC (permalink / raw)
To: Dan Carpenter; +Cc: kernel-janitors, linux-mtd, Adrian Hunter
[-- Attachment #1: Type: text/plain, Size: 345 bytes --]
On Sat, 2012-06-09 at 12:08 +0300, Dan Carpenter wrote:
> 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.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Pushed to linux-ubifs.git, thanks!
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-18 11:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-09 9:08 [patch] UBIFS: change | to & in assertion Dan Carpenter
2012-06-18 11:20 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox