From: Juergen Gross <jgross@suse.com>
To: "Pasi Kärkkäinen" <pasik@iki.fi>
Cc: jbeulich@suse.com, xen-devel@lists.xen.org
Subject: Re: [PATCH Linux-2.6.18] scsifront: avoid aquiring same lock twice if ring is full
Date: Wed, 14 Jan 2015 05:27:12 +0100 [thread overview]
Message-ID: <54B5F020.3080903@suse.com> (raw)
In-Reply-To: <20150113185358.GE5962@reaktio.net>
On 01/13/2015 07:53 PM, Pasi Kärkkäinen wrote:
> Hi,
>
> On Tue, Jan 13, 2015 at 05:22:58PM +0100, Juergen Gross wrote:
>> The locking in scsifront_dev_reset_handler() is obviously wrong. In
>> case of a full ring the host lock is aquired twice.
>>
>> Fixing this issue enables to get rid of the endless fo loop with an
>> explicit break statement.
>>
>
> Is this patch needed in upstream Linux kernel aswell, now that Xen PVSCSI drivers are in upstream Linux ?
No, especially this part of the code was reorganized and doesn't
have that issue.
Juergen
>
>
> Thanks,
>
> -- Pasi
>
>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> ---
>>
>> diff -r 078f1bb69ea5 drivers/xen/scsifront/scsifront.c
>> --- a/drivers/xen/scsifront/scsifront.c Wed Dec 10 10:22:39 2014 +0100
>> +++ b/drivers/xen/scsifront/scsifront.c Tue Jan 13 14:32:33 2015 +0100
>> @@ -447,12 +447,10 @@ static int scsifront_dev_reset_handler(s
>> uint16_t rqid;
>> int err = 0;
>>
>> - for (;;) {
>> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
>> - spin_lock_irq(host->host_lock);
>> + spin_lock_irq(host->host_lock);
>> #endif
>> - if (!RING_FULL(&info->ring))
>> - break;
>> + while (RING_FULL(&info->ring)) {
>> if (err) {
>> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
>> spin_unlock_irq(host->host_lock);
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>
next prev parent reply other threads:[~2015-01-14 4:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 16:22 [PATCH Linux-2.6.18] scsifront: avoid aquiring same lock twice if ring is full Juergen Gross
2015-01-13 18:53 ` Pasi Kärkkäinen
2015-01-14 4:27 ` Juergen Gross [this message]
2015-01-14 9:40 ` Jan Beulich
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=54B5F020.3080903@suse.com \
--to=jgross@suse.com \
--cc=jbeulich@suse.com \
--cc=pasik@iki.fi \
--cc=xen-devel@lists.xen.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.