[PATCH] [MTD] Fix JFFS2 sync silent failure

Jens Axboe jens.axboe at oracle.com
Mon Apr 19 03:38:44 EDT 2010


On Sat, Apr 17 2010, Jörn Engel wrote:
> Moin David,
> 
> if I read the code correctly, JFFS2 will happily perform a NOP on
> sys_sync() again.  And this time it appears to be Jens' fault.
> 
> JFFS2 does not appear to set s_bdi anywhere.  And as of 32a88aa1,
> __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.
> 
> The patch also adds a BUG_ON to catch this problem in any remaining or
> future offenders.  I am not sure about network filesystems, but at
> least bdev- and mtd-based ones should be caught.
> 
> Opinions?

I think that BUG_ON() would be a lot better as a printk() and fail mount
instead. There's really little point in killing the kernel for something
you could easily warn about and recover nicely.

-- 
Jens Axboe




More information about the linux-mtd mailing list