]> git.baikalelectronics.ru Git - kernel.git/commit
floppy: remove floppy-specific O_EXCL handling
authorJiri Kosina <jkosina@suse.cz>
Fri, 18 May 2012 11:50:28 +0000 (13:50 +0200)
committerJiri Kosina <jkosina@suse.cz>
Fri, 18 May 2012 13:19:11 +0000 (15:19 +0200)
commit2a31c1d05b7069786f124e9d316c2f4a02021b49
tree70c1ace62544811e7f4f39f8bab8b85ee9f89017
parent2406b2f72442d1b226f9b1d73b06a944a5eac8cc
floppy: remove floppy-specific O_EXCL handling

Block layer now handles O_EXCL in a generic way for block devices.

The semantics is however different for floppy and all other block devices,
as floppy driver contains its own O_EXCL handling.

The semantics for all-but-floppy bdevs is "there can be at most one O_EXCL
open of this file", while for floppy bdev the semantics is "if someone has
the bdev open with O_EXCL, noone else can open it".

There is actual userspace-observable change in behavior because of this
since commit 07694f05d1c8c ("block: make blkdev_get/put() handle exclusive
access") -- on kernels containing this commit, mount of /dev/fd0 causes
the fd0 block device be claimed with _EXCL, preventing subsequent
open(/dev/fd0).

Bring things back into shape, i.e.  make it possible, analogically to
other block devices, to mount the floppy and open() it afterwards --
remove the floppy-specific handling and let the generic bdev code O_EXCL
handling take over.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: NeilBrown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/block/floppy.c