]> git.hungrycats.org Git - linux/commit
[PATCH] invalidate_device()/check_disk_change() fixes
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Thu, 24 Apr 2003 15:39:06 +0000 (08:39 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 24 Apr 2003 15:39:06 +0000 (08:39 -0700)
commit91b58109a339748d992cb767e145c19722756653
tree7a02b8525e330f58aca6aa009a0ca9fbb40b9ce2
parent45065e1014b07ff09f279b01828bfa5d3a6eeb17
[PATCH] invalidate_device()/check_disk_change() fixes

* bogus calls of invalidate_buffers() gone from floppy_open()
* invalidate_buffers() killed.

* new helper - __invalidate_device(bdev, do_sync).  invalidate_device()
is calling it.

* fixed races between floppy_open()/floppy_open and
floppy_open()/set_geometry():
a) floppy_open()/floppy_release() is done under a semaphore.  That
closes the races between simultaneous open() on /dev/fd0foo and /dev/fd0bar.
b) pointer to struct block_device is kept as long as floppy is
opened (per-drive, non-NULL when number of openers is non-zero, does not
contribute to block_device refcount).
c) set_geometry() grabs the same semaphore and invalidates the
devices directly instead of messing with setting fake "it had changed"
and calling __check_disk_change().

* __check_disk_change() killed - no remaining callers
* full_check_disk_change() killed - ditto.
12 files changed:
drivers/acorn/block/fd1772.c
drivers/block/amiflop.c
drivers/block/ataflop.c
drivers/block/floppy.c
drivers/block/floppy98.c
drivers/block/paride/pt.c
fs/block_dev.c
fs/buffer.c
fs/inode.c
include/linux/buffer_head.h
include/linux/fs.h
kernel/ksyms.c