Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2972909pxk; Mon, 21 Sep 2020 01:47:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiDjDBj5JCQs5KCcubsTHGLDwumTW/k/HxwFmIe3ZgpSTxy+sAkJdZPd5U3S67pdA2KwTp X-Received: by 2002:a50:f199:: with SMTP id x25mr49664241edl.347.1600678038051; Mon, 21 Sep 2020 01:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600678038; cv=none; d=google.com; s=arc-20160816; b=pC85QnHfLFhyZhRL5tFTCUwDxRQtvFLFPRrr3SYAFLkIoXbhF8XlOsVw4MEuvogUeU bF2r9URAdIIwGsxxiBOOkt0hxb6vxeJi0W/9YeOVB9+YcxJ9Cpj0YoBgxiGtdJNCJO+d CnUciYGJVlv7pZVIK18KNyyb3PgLw6zUlwAzghDGKz3z51MCaOVk1pbBhxxMpXTDwSXR UBUM7ci7HtrlXpbGnKBvrh0UAx4ReHpDkRFQKql8JfWnQdQpe9CtziJ+cpwX3wA6NC6f oRVEDz7vQThxBW4d5MhDTW3DRyN8DzVJzcjWYDWrmvJJkVZlvUv4DFEYBlAawwHmt+dE Tq7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=CZmaZ187zMFdVdjh+DfPERuCP3WU0wLxzZIFDgqpQhQ=; b=ld1S5+UaoxUx/SO4L/JAKLjNWr8M/cTeDww+wIOj8FWcxgMwy6ZZysTC+5Ep1ok0lX bz96wteNKL69Tol+23oTJM63oNPJNyUImmQGX0vvJzTaqlt4Po/VDJwttg78WJagpIgl FdungzHncVWzgh7upXtxJcNr8VJ0rosBauubavBTmFsnZp3yOVEehRGCCxX7izy6bXck X8Dv6Okth/n3uH/RNcQdNylG/wKSLMTgEAY8GyyfrQI84JqD3vpx5MPe+VlfZOdgFOwA fxJifZpTh33Xd/CimLLPnpAwejszmFPmMlf8D6I0SLZdEgXYMTe+t20I2nFCxliHqAWT N5xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UWXytXWm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr5si8112970ejc.370.2020.09.21.01.46.54; Mon, 21 Sep 2020 01:47:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UWXytXWm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726424AbgIUIpz (ORCPT + 99 others); Mon, 21 Sep 2020 04:45:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726236AbgIUIpz (ORCPT ); Mon, 21 Sep 2020 04:45:55 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB354C061755; Mon, 21 Sep 2020 01:45:54 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id k25so10354629ljg.9; Mon, 21 Sep 2020 01:45:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CZmaZ187zMFdVdjh+DfPERuCP3WU0wLxzZIFDgqpQhQ=; b=UWXytXWmkq8pXmYqB0sXkFrf5u7O8zADyv3pKBcOd43273LrLEK/6dwQie7xrTzsFY om+1pH6WEDJNAT2FC5RZEXob/KRC6BhuELwRQTtlvWyS36FiytI4T13PRHgaPvhqTOmm JnxMoCogivVva8Xm2cqsnuYpJ5d7lJj6ft92HDVD4p/9uEForZYyO+gdHPYZMAUq++Qq M1rqpVX3Vnj2KoBKnqSQr5mA55K3Ux9Svkrgvl7128w9LytJpLCirpoWpIfX+fiWXgLN hfRQHGkBqoDrOX6dl6WzzpJsP4xUBo+tICCmmkS34li8nJVViMd6ZQnNGiU/epbwh+QT 3mDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=CZmaZ187zMFdVdjh+DfPERuCP3WU0wLxzZIFDgqpQhQ=; b=gc9RUqGvyZasbDWoF4cPdreyGZ031WAIpkLUduqMMRRniCMMkwpVk5KvGYxDFH9m4v rW+dq6/DxaCWTma9T+PrhAECJnC7hTrMzUNhFOaHiSx1W+ShFSgbyRA43fu6aVmIV6u3 TndqpvwrDhnnfALh+tWxXrWvl3afy0g6AJslOXwj0Fy9gYEmmJWq+p33z7RvWjonDbN2 BOMGulKRFCra9UbEAGXL3yzp80InYxcEIqk1u4FuJFouAZGdwMPe11yvCmuuiZTBSAq7 9WfFEKNhJuxTgoVX9rYR7LCMW5I3x8X7Nj3Ob7kf3CjJBflt4cWrRqvYAwLL912TG/gY 8LDw== X-Gm-Message-State: AOAM530G0V/N9EdGhIVxXZPdKH6PFRm8PfqpG4GbAp0VsSZiina+dCuo 79Rr2NICPia7oQ4GClgZVusiJC/uu0eFEA== X-Received: by 2002:a2e:2c0e:: with SMTP id s14mr15080290ljs.174.1600677953001; Mon, 21 Sep 2020 01:45:53 -0700 (PDT) Received: from ?IPv6:2a00:1fa0:485b:5520:1d32:5ffa:5dce:483f? ([2a00:1fa0:485b:5520:1d32:5ffa:5dce:483f]) by smtp.gmail.com with ESMTPSA id u14sm2551614lji.83.2020.09.21.01.45.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Sep 2020 01:45:52 -0700 (PDT) Subject: Re: [PATCH 08/14] dasd: cleanup dasd_scan_partitions To: Christoph Hellwig , Jens Axboe Cc: Josef Bacik , Minchan Kim , Stefan Haberland , Jan Hoeppner , Joseph Qi , "Rafael J. Wysocki" , Pavel Machek , Len Brown , Andrew Morton , linux-kernel@vger.kernel.org, nbd@other.debian.org, linux-ide@vger.kernel.org, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org References: <20200921071958.307589-1-hch@lst.de> <20200921071958.307589-9-hch@lst.de> From: Sergei Shtylyov Organization: Brain-dead Software Message-ID: <28f7f012-2787-2959-394e-cda480786ea9@gmail.com> Date: Mon, 21 Sep 2020 11:45:46 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200921071958.307589-9-hch@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On 21.09.2020 10:19, Christoph Hellwig wrote: > Use blkdev_get_by_dev instead of bdget_disk + blkdev_get. > > Signed-off-by: Christoph Hellwig > --- > drivers/s390/block/dasd_genhd.c | 15 ++++----------- > 1 file changed, 4 insertions(+), 11 deletions(-) > > diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c > index af5b0ecb8f8923..a9698fba9b76ce 100644 > --- a/drivers/s390/block/dasd_genhd.c > +++ b/drivers/s390/block/dasd_genhd.c > @@ -101,18 +101,11 @@ int dasd_scan_partitions(struct dasd_block *block) > struct block_device *bdev; > int rc; > > - bdev = bdget_disk(block->gdp, 0); > - if (!bdev) { > - DBF_DEV_EVENT(DBF_ERR, block->base, "%s", > - "scan partitions error, bdget returned NULL"); > - return -ENODEV; > - } > - > - rc = blkdev_get(bdev, FMODE_READ, NULL); > - if (rc < 0) { > + bdev = blkdev_get_by_dev(disk_devt(block->gdp), FMODE_READ, NULL); > + if (IS_ERR(bdev)) { > DBF_DEV_EVENT(DBF_ERR, block->base, > - "scan partitions error, blkdev_get returned %d", > - rc); > + "scan partitions error, blkdev_get returned %ld", blkdev_get_by_dev() now? > + PTR_ERR(bdev)); > return -ENODEV; > } > MBR, Sergei