• Alexander Viro's avatar
    [PATCH] invalidate_device()/check_disk_change() fixes · 91b58109
    Alexander Viro authored
    	* 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.
    91b58109
ataflop.c 51.9 KB