From: Sander Eikelenboom <linux@eikelenboom.it>
To: "Jürgen Groß" <jgross@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Jens Axboe <axboe@kernel.dk>
Subject: Re: [Xen-devel] [PATCH v2] xen/blkfront: fix ring info addressing
Date: Thu, 5 Mar 2020 16:47:01 +0100 [thread overview]
Message-ID: <68f09f4e-180f-0fb7-c329-f3f03be72eb6@eikelenboom.it> (raw)
In-Reply-To: <c2c1573a-8c98-4a99-64fb-1346ee724d08@suse.com>
On 05/03/2020 14:40, Jürgen Groß wrote:
> On 05.03.20 13:42, Roger Pau Monné wrote:
>> On Thu, Mar 05, 2020 at 12:40:44PM +0100, Juergen Gross wrote:
>>> Commit 0265d6e8ddb890 ("xen/blkfront: limit allocated memory size to
>>> actual use case") made struct blkfront_ring_info size dynamic. This is
>>> fine when running with only one queue, but with multiple queues the
>>> addressing of the single queues has to be adapted as the structs are
>>> allocated in an array.
>>>
>>> Fixes: 0265d6e8ddb890 ("xen/blkfront: limit allocated memory size to actual use case")
>>> Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>> ---
>>> V2:
>>> - get rid of rinfo_ptr() helper
>>> - use proper parenthesis in for_each_rinfo()
>>> - rename rinfo parameter of for_each_rinfo()
>>> ---
>>> drivers/block/xen-blkfront.c | 79 +++++++++++++++++++++++---------------------
>>> 1 file changed, 42 insertions(+), 37 deletions(-)
>>>
>>> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
>>> index e2ad6bba2281..8e844da826db 100644
>>> --- a/drivers/block/xen-blkfront.c
>>> +++ b/drivers/block/xen-blkfront.c
>>> @@ -213,6 +213,7 @@ struct blkfront_info
>>> struct blk_mq_tag_set tag_set;
>>> struct blkfront_ring_info *rinfo;
>>> unsigned int nr_rings;
>>> + unsigned int rinfo_size;
>>> /* Save uncomplete reqs and bios for migration. */
>>> struct list_head requests;
>>> struct bio_list bio_list;
>>> @@ -259,6 +260,18 @@ static int blkfront_setup_indirect(struct blkfront_ring_info *rinfo);
>>> static void blkfront_gather_backend_features(struct blkfront_info *info);
>>> static int negotiate_mq(struct blkfront_info *info);
>>>
>>> +#define for_each_rinfo(info, ptr, idx) \
>>> + for ((ptr) = (info)->rinfo, (idx) = 0; \
>>> + (idx) < (info)->nr_rings; \
>>> + (idx)++, (ptr) = (void *)(ptr) + (info)->rinfo_size)
>>> +
>>> +static struct blkfront_ring_info *get_rinfo(struct blkfront_info *info,
>>
>> I still think inline should be added here, but I don't have such a
>> strong opinion to block the patch on it.
>
> I can add it if you like that better. Won't make much difference in the
> end.
>
>> Also, info should be constified AFAICT.
>
> Yes.
>
>>
>> With at least info constified:
>>
>> Acked-by: Roger Pau Monné <roger.pau@citrix.com>
>>
>> Can you queue this through the Xen tree?
>
> Sure.
>
>
> Juergen
>
Just tested v2 and it works for me, thanks !
--
Sander
prev parent reply other threads:[~2020-03-05 15:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-05 11:40 Juergen Gross
2020-03-05 12:42 ` Roger Pau Monné
2020-03-05 13:40 ` Jürgen Groß
2020-03-05 15:47 ` Sander Eikelenboom [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=68f09f4e-180f-0fb7-c329-f3f03be72eb6@eikelenboom.it \
--to=linux@eikelenboom.it \
--cc=axboe@kernel.dk \
--cc=boris.ostrovsky@oracle.com \
--cc=jgross@suse.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®