From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753377AbbDFNvk (ORCPT ); Mon, 6 Apr 2015 09:51:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54742 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753174AbbDFNvf (ORCPT ); Mon, 6 Apr 2015 09:51:35 -0400 Date: Mon, 6 Apr 2015 09:51:34 -0400 From: Jarod Wilson To: Ming Lei Cc: Jens Axboe , linux-kernel@vger.kernel.org, Christoph Hellwig , Tejun Heo , Andrew Morton , Alexander Viro , David Herrmann , Markus Pargmann , nbd-general@lists.sourceforge.net, Stefan Haberland , Sebastian Ott , Fabian Frederick , linux-s390@vger.kernel.org Subject: Re: [PATCH 5/6] block: dasd_genhd: convert to blkdev_reread_part Message-ID: <20150406135134.GG14217@redhat.com> References: <1428218688-4092-1-git-send-email-ming.lei@canonical.com> <1428218688-4092-6-git-send-email-ming.lei@canonical.com> <20150406134655.GE14217@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150406134655.GE14217@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 06, 2015 at 09:46:55AM -0400, Jarod Wilson wrote: > On Sun, Apr 05, 2015 at 03:24:47PM +0800, Ming Lei wrote: > > Also remove the obsolete comment. > > > > Signed-off-by: Ming Lei > > --- > > drivers/s390/block/dasd_genhd.c | 9 +++------ > > 1 file changed, 3 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c > > index 90f39f7..2af4619 100644 > > --- a/drivers/s390/block/dasd_genhd.c > > +++ b/drivers/s390/block/dasd_genhd.c > > @@ -116,14 +116,11 @@ int dasd_scan_partitions(struct dasd_block *block) > > rc); > > return -ENODEV; > > } > > - /* > > - * See fs/partition/check.c:register_disk,rescan_partitions > > - * Can't call rescan_partitions directly. Use ioctl. > > - */ > > - rc = ioctl_by_bdev(bdev, BLKRRPART, 0); > > + > > + rc = blkdev_reread_part(bdev); > > while (rc == -EBUSY && retry > 0) { > > schedule(); > > - rc = ioctl_by_bdev(bdev, BLKRRPART, 0); > > + rc = blkdev_reread_part(bdev); > > retry--; > > DBF_DEV_EVENT(DBF_ERR, block->base, > > "scan partitions error, retry %d rc %d", > > Note: patch 6/6 in the series makes this whole while() loops pointless, > since the possibility of the -EBUSY return goes away. Minor clarification: the -EBUSY due to the trylock, which is why that retry loop exists, goes away. You *could* still get an -EBUSY through blkdev_reread_part()->rescan_partitions()->drop_partitions() if bdev->bd_part_count is non-zero. -- Jarod Wilson jarod@redhat.com