Skip to content

Commit

Permalink
Fix JFFS2 sync silent failure
Browse files Browse the repository at this point in the history
JFFS2 does not appear to set s_bdi anywhere.  And as of 32a88aa,
__sync_filesystem() will return 0 if s_bdi is not set.  As a result,
sync_fs() is never called for jffs2 and whatever remains in the wbuf
will not make it to the device.

Fix that up by assigning the mtd bdi.

Signed-off-by: Jörn Engel <joern@logfs.org>
Acked-By: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Jörn Engel authored and Jens Axboe committed Apr 22, 2010
1 parent 424264b commit 6de9400
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mtd/mtdsuper.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/mtd/super.h>
#include <linux/namei.h>
#include <linux/ctype.h>
#include <linux/slab.h>

/*
* compare superblocks to see if they're equivalent
Expand Down Expand Up @@ -44,6 +45,7 @@ static int get_sb_mtd_set(struct super_block *sb, void *_mtd)

sb->s_mtd = mtd;
sb->s_dev = MKDEV(MTD_BLOCK_MAJOR, mtd->index);
sb->s_bdi = mtd->backing_dev_info;
return 0;
}

Expand Down

0 comments on commit 6de9400

Please sign in to comment.