Re: oops 2.3.3[7,8] floppy mount/umount

From: Peter Denison (peterd@pnd-pc.demon.co.uk)
Date: Sat Jan 08 2000 - 17:15:37 EST


> Two oops here, first is floppy mount on 2.3.38 (i586),
> second is floppy umount on 2.3.37 (i486). Last known
> no problem version was 2.3.36 (i586). Rarely use the
> floppy.
> --
> Pete Clements
> clem@clem.digital.net
>
> ksymoops 0.7c on i586 2.3.38. Options used
[snip]
> Unable to handle kernel NULL pointer dereference at virtual address 00000008
> c01b0fa3
> EIP: 0010:[floppy_release+35/160]
> EFLAGS: 00010246
> eax: c69b0000 ebx: 00000000 ecx: 00000000 edx: c69b0000
> [snip]
> Call Trace: [blkdev_put+143/240] [blkdev_close+18/32] [__fput+31/80]
> [_fput+17/64] [filp_close+107/128] [do_close+91/112] [sys_close+12/16]
> Code: 8b 41 08 50 51 e8 13 1e f8 ff be 08 58 29 c0 8d 04 5b 8d 04
>
> ------------------------------------------------------------------------
>
> ksymoops 0.7c on i486 2.3.37. Options used
> Jan 8 09:24:55 clem kernel: Unable to handle kernel NULL pointer
> dereference at virtual address 00000008
> Jan 8 09:24:55 clem kernel: c01aec13
> Jan 8 09:24:55 clem kernel: EIP: 0010:[floppy_release+35/160]
[snip]
> Jan 8 09:24:55 clem kernel: Call Trace: [blkdev_put+170/256]
> [get_filesystem_info+384/768] [umount_dev+158/272] [sys_umount+193/208]
> [sys_oldumount+12/16] [system_call+52/56]
> Jan 8 09:24:55 clem kernel: Code: 8b 41 08 50 51 e8 03 35 f8 ff be b4
> ad 27 c0 8d 04 5b 8d 04

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/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:13 EST