diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2014-06-25 14:08:03 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-07-17 22:07:34 +0200 |
commit | cc833acbee9db5ca8c6162b015b4c93863c6f821 (patch) | |
tree | 31bdb4b633e51731fcb35383f8e3bee59765378d /drivers/scsi/Kconfig | |
parent | 16070cc189c5e343696c29c8cff779e692cfcb8d (diff) | |
download | op-kernel-dev-cc833acbee9db5ca8c6162b015b4c93863c6f821.zip op-kernel-dev-cc833acbee9db5ca8c6162b015b4c93863c6f821.tar.gz |
sg: O_EXCL and other lock handling
This addresses a problem reported by Vaughan Cao concerning
the correctness of the O_EXCL logic in the sg driver. POSIX
doesn't defined O_EXCL semantics on devices but "allow only
one open file descriptor at a time per sg device" is a rough
definition. The sg driver's semantics have been to wait
on an open() when O_NONBLOCK is not given and there are
O_EXCL headwinds. Nasty things can happen during that wait
such as the device being detached (removed). So multiple
locks are reworked in this patch making it large and hard
to break down into digestible bits.
This patch is against Linus's current git repository which
doesn't include any sg patches sent in the last few weeks.
Hence this patch touches as little as possible that it
doesn't need to and strips out most SCSI_LOG_TIMEOUT()
changes in v3 because Hannes said he was going to rework all
that stuff.
The sg3_utils package has several test programs written to
test this patch. See examples/sg_tst_excl*.cpp .
Not all the locks and flags in sg have been re-worked in
this patch, notably sg_request::done . That can wait for
a follow-up patch if this one meets with approval.
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/scsi/Kconfig')
0 files changed, 0 insertions, 0 deletions