From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754885AbcG0LAB (ORCPT ); Wed, 27 Jul 2016 07:00:01 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:12354 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752142AbcG0K74 (ORCPT ); Wed, 27 Jul 2016 06:59:56 -0400 X-IronPort-AV: E=Sophos;i="5.28,429,1464652800"; d="scan'208";a="375699083" Date: Wed, 27 Jul 2016 12:59:49 +0200 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: Bob Liu CC: , , Subject: Re: [PATCH v3] xen-blkfront: dynamic configuration of per-vbd resources Message-ID: <20160727105949.3rtlnl2zr4lpsvbc@mac> References: <1469589685-31630-1-git-send-email-bob.liu@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1469589685-31630-1-git-send-email-bob.liu@oracle.com> User-Agent: Mutt/1.6.2-neo (2016-06-11) X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > + if (part_in_flight(&info->gd->part0) || info->reconfiguring) { > + blk_mq_unfreeze_queue(info->rq); > + pr_err("Dev:%s busy, please retry later.\n", dev_name(&info->xbdev->dev)); > + return -EBUSY; > + } Roger.