* question about jffs2: jffs2_scan_dirty_space() return value
@ 2010-10-15 11:59 Roman Borisov
0 siblings, 0 replies; only message in thread
From: Roman Borisov @ 2010-10-15 11:59 UTC (permalink / raw)
To: linux-mtd
hello,
The question was born when I discovered that in fs/jffs2/scan.c
jffs2_scan_medium() a return value from fs/jffs2/nodelist.c
jffs2_scan_dirty_space() is not checked;
However return value from jffs2_scan_dirty_space() is checked anywhere else.
jffs2_scan_dirty_space() investigation showed that it can't return
anything except 0;
The question is: should the jffs2_scan_dirty_space() be changed to
return some error instead BUG() macro for example?
<code>
if (unlikely(size > jeb->free_size)) {
printk(KERN_CRIT "Dirty space 0x%x larger then free_size 0x%x
(wasted 0x%x)\n",
size, jeb->free_size, jeb->wasted_size);
- BUG();
+ return some_error;
}
</code>
In this case we also should update jffs2_scan_medium() to check the
error code.
Thanks,
Roman
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-10-15 11:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-15 11:59 question about jffs2: jffs2_scan_dirty_space() return value Roman Borisov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.