I can confirm these are happening for me, with floppy as module (you have
it compiled in, right?) and on 2.3.38.
It seems that we're getting to floppy_release() with filp = 0, and falling
over at the line: drivers/block/floppy.c:3634
block_fsync(filp, filp->f_dentry);
Because at fs/block_dev.c:615, in blkdev_put() we're called as
ret = bdev->bd_op->release(fake_inode, NULL);
Question is, can we just ignore the fact, and wrap the block_fsync() in
floppy_release() with an if (filp) {...} ? Or is it more involved? I'm
also worried by the bit in blkdev_put that says:
down(&bdev->bd_sem);
/* syncing will go here */
if (atomic_dec_and_test(&bdev->bd_openers)) {
Doesn't it sync yet? I shall let wiser men than me sort it out, or I'll
just make it worse....
The patch that changed this was 2.3.37, and the original in this fragment
from floppy.c seems fine. Why did it change?
- /*
- * If filp is NULL, we're being called from blkdev_release
- * or after a failed mount attempt. In the former case the
- * device has already been sync'ed, and in the latter no
- * sync is required. Otherwise, sync if filp is writable.
- */
- if (filp && (filp->f_mode & (2 | OPEN_WRITE_BIT)))
- block_fsync(filp, filp->f_dentry);
+ block_fsync(filp, filp->f_dentry);
-- Peter Denison <peterd@pnd-pc.demon.co.uk> Linux Driver for Promise DC4030VL cards. See http://www.pnd-pc.demon.co.uk/promise/promise.html for details
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/