lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 27 Jul 2016 19:21:05 +0800
From:	Bob Liu <bob.liu@...cle.com>
To:	Roger Pau Monné <roger.pau@...rix.com>
CC:	linux-kernel@...r.kernel.org, xen-devel@...ts.xenproject.org,
	konrad.wilk@...cle.com
Subject: Re: [PATCH v3] xen-blkfront: dynamic configuration of per-vbd resources


On 07/27/2016 06:59 PM, Roger Pau Monné wrote:
> On Wed, Jul 27, 2016 at 11:21:25AM +0800, Bob Liu wrote:
> [...]
>> +static ssize_t dynamic_reconfig_device(struct blkfront_info *info, ssize_t count)
>> +{
>> +	/*
>> +	 * Prevent new requests even to software request queue.
>> +	 */
>> +	blk_mq_freeze_queue(info->rq);
>> +
>> +	/*
>> +	 * Guarantee no uncompleted reqs.
>> +	 */
> 
> I'm also wondering, why do you need to guarantee that there are no 
> uncompleted requests? The resume procedure is going to call blkif_recover 
> that will take care of requeuing any unfinished requests that are on the 
> ring.
> 

Because there may have requests in the software request queue with more segments than
we can handle(if info->max_indirect_segments is reduced).

The blkif_recover() can't handle this since blk-mq was introduced,
because there is no way to iterate the sw-request queues(blk_fetch_request() can't be used by blk-mq).

So there is a bug in blkif_recover(), I was thinking implement the suspend function of blkfront_driver like:

+static int blkfront_suspend(struct xenbus_device *dev)
+{
+       blk_mq_freeze_queue(info->rq);
+       ..
+}
 static struct xenbus_driver blkfront_driver = {
        .ids  = blkfront_ids,
        .probe = blkfront_probe,
        .remove = blkfront_remove,
+       .suspend = blkfront_suspend,
        .resume = blkfront_resume,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ