summaryrefslogtreecommitdiffstats
path: root/fs/jffs2/scan.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-03-08 06:55:36 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-08 23:14:01 +0100
commite96fb230cc97760e448327c0de612cfba94ca7bf (patch)
tree1f7d0280c9c2286c790754abf779b8e03a8de92d /fs/jffs2/scan.c
parent[PATCH] fix file counting (diff)
downloadlinux-e96fb230cc97760e448327c0de612cfba94ca7bf.tar.xz
linux-e96fb230cc97760e448327c0de612cfba94ca7bf.zip
[PATCH] jffs2: avoid divide-by-zero
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/jffs2/scan.c')
-rw-r--r--fs/jffs2/scan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 3e51dd1da8aa..cf55b221fc2b 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -233,7 +233,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
c->nextblock->dirty_size = 0;
}
#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
- if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size % c->wbuf_pagesize)) {
+ if (!jffs2_can_mark_obsolete(c) && c->wbuf_pagesize && c->nextblock && (c->nextblock->free_size % c->wbuf_pagesize)) {
/* If we're going to start writing into a block which already
contains data, and the end of the data isn't page-aligned,
skip a little and align it. */