From: Christoph Hellwig <hch@lst.de>
To: Hannes Reinecke <hare@suse.de>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
Christoph Hellwig <hch@lst.de>,
James Bottomley <james.bottomley@hansenpartnership.com>,
Johannes Thumshirn <jth@kernel.org>,
Doug Gilberg <dgilbert@interlog.com>,
linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.com>
Subject: Re: [PATCHv3 3/6] sg: protect accesses to 'reserved' page array
Date: Fri, 3 Feb 2017 14:31:40 +0100 [thread overview]
Message-ID: <20170203133140.GC646@lst.de> (raw)
In-Reply-To: <1486127531-13716-4-git-send-email-hare@suse.de>
> - if (sg_res_in_use(sfp)) {
> + mutex_lock(&sfp->f_mutex);
> + if (sfp->res_in_use) {
> + mutex_unlock(&sfp->f_mutex);
> sg_remove_request(sfp, srp);
> return -EBUSY; /* reserve buffer already being used */
> }
> + mutex_unlock(&sfp->f_mutex);
Holding a mutex over a the check of a single scalar doesn't make sense.
next prev parent reply other threads:[~2017-02-03 13:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-03 13:12 [PATCHv3 0/6] sanitize sg Hannes Reinecke
2017-02-03 13:12 ` [PATCHv3 1/6] sg: disable SET_FORCE_LOW_DMA Hannes Reinecke
2017-02-03 13:29 ` Christoph Hellwig
2017-02-03 13:12 ` [PATCHv3 2/6] sg: remove 'save_scat_len' Hannes Reinecke
2017-02-03 13:29 ` Christoph Hellwig
2017-02-03 13:12 ` [PATCHv3 3/6] sg: protect accesses to 'reserved' page array Hannes Reinecke
2017-02-03 13:31 ` Christoph Hellwig [this message]
2017-02-03 13:38 ` Hannes Reinecke
2017-02-03 16:19 ` Christoph Hellwig
2017-02-03 18:06 ` Johannes Thumshirn
2017-02-03 18:21 ` James Bottomley
2017-02-03 13:12 ` [PATCHv3 4/6] sg: check for valid direction before starting the request Hannes Reinecke
2017-02-03 13:12 ` [PATCHv3 5/6] sg: use standard lists for sg_requests Hannes Reinecke
2017-02-03 13:12 ` [PATCHv3 6/6] sg: close race condition in sg_remove_sfp_usercontext() Hannes Reinecke
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=20170203133140.GC646@lst.de \
--to=hch@lst.de \
--cc=dgilbert@interlog.com \
--cc=hare@suse.com \
--cc=hare@suse.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=jth@kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@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;
as well as URLs for NNTP newsgroup(s).