public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: dgilbert@interlog.com,
	SCSI development list <linux-scsi@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>
Cc: James Bottomley <james.bottomley@hansenpartnership.com>,
	vaughan <vaughan.cao@oracle.com>
Subject: Re: [PATCH v4] sg: O_EXCL and other lock handling
Date: Sat, 21 Jun 2014 13:01:21 +0200	[thread overview]
Message-ID: <53A56601.9010701@suse.de> (raw)
In-Reply-To: <539A453F.5020502@interlog.com>

On 06/13/2014 02:26 AM, Douglas Gilbert wrote:
> This is a re-presentation of a patch to the sg driver
> whose v3 was sent in November 2013:
>    http://www.spinics.net/lists/linux-scsi/msg69957.html
>
> It 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.
>
> ChangeLog v4:
>    - based on the current kernel tree: pre 3.16-rc1
>    - strip out clean-ups in v3 that others are better
>      placed to do (e.g. debug/logging)
>    - simplify open_wait_event() logic and add comment
>
> ChangeLog v3 and earlier: see link in the first paragraph.
>
>
> Could anyone confirm whether v3 of this patch has found its
> way into any distro and/or been tested or used more widely?
>
> Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
>
>
We've tested a similar version here.

Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2014-06-21 11:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-13  0:26 [PATCH v4] sg: O_EXCL and other lock handling Douglas Gilbert
2014-06-13  9:03 ` Christoph Hellwig
2014-06-13 14:33   ` Douglas Gilbert
2014-06-16 13:45     ` Christoph Hellwig
2014-06-13 20:18   ` Douglas Gilbert
2014-06-21 11:01 ` Hannes Reinecke [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53A56601.9010701@suse.de \
    --to=hare@suse.de \
    --cc=dgilbert@interlog.com \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=vaughan.cao@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox