aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/scsi
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2014-06-25 14:08:03 +0200
committerChristoph Hellwig <hch@lst.de>2014-07-17 22:07:34 +0200
commitcc833acbee9db5ca8c6162b015b4c93863c6f821 (patch)
tree31bdb4b633e51731fcb35383f8e3bee59765378d /Documentation/scsi
parentsg: add SG_FLAG_Q_AT_TAIL flag (diff)
downloadlinux-dev-cc833acbee9db5ca8c6162b015b4c93863c6f821.tar.xz
linux-dev-cc833acbee9db5ca8c6162b015b4c93863c6f821.zip
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 'Documentation/scsi')
0 files changed, 0 insertions, 0 deletions