From patchwork Mon Oct 12 13:30:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 270259 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7A62C433E7 for ; Mon, 12 Oct 2020 13:56:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7BFED2076E for ; Mon, 12 Oct 2020 13:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602511015; bh=6oJ223lUE7Q/unMQomk+APF9/Oh4iCmwYXc1Lf8CVmM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ngZuajAZ+rjtYk58+mcYhhBu/XWFX224hWPHOlyoCzSIyiaNgsF9/0YKhREV9yUr8 7hHDohiEzfvHKMTIesiLy7LnV07v/fgRVBHiKjZpirSqglJjerPq5bFxCoYoHwpye6 dvmPhd3XF4vWNMkWmAzVBmiopJwtUzVRsJtD5SOc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390551AbgJLN4r (ORCPT ); Mon, 12 Oct 2020 09:56:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:48296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389425AbgJLNoE (ORCPT ); Mon, 12 Oct 2020 09:44:04 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D864820838; Mon, 12 Oct 2020 13:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510231; bh=6oJ223lUE7Q/unMQomk+APF9/Oh4iCmwYXc1Lf8CVmM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yJHn0tl8JNmKzlfpRLTQa4XKZAJbtQKySEa06dxprm54fhY/R98BiY3fUFiSZoqnH 6aRCOa3TP8ReNql6fwOdIrvAgCsqsjFiYaBFYGdj+YwYwH6Do3uWi8aR5d0Abf55cs ImaSz5fDzhqUh3Pd73qdaSpdVdlrTbzLx8z1+Cns= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Borntraeger , Christoph Hellwig , Stefan Haberland , Jens Axboe Subject: [PATCH 5.8 011/124] partitions/ibm: fix non-DASD devices Date: Mon, 12 Oct 2020 15:30:15 +0200 Message-Id: <20201012133147.397962071@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012133146.834528783@linuxfoundation.org> References: <20201012133146.834528783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Christoph Hellwig commit 7370997d48520ad923e8eb4deb59ebf290396202 upstream. Don't error out if the dasd_biodasdinfo symbol is not available. Cc: stable@vger.kernel.org Fixes: 26d7e28e3820 ("s390/dasd: remove ioctl_by_bdev calls") Reported-by: Christian Borntraeger Signed-off-by: Christoph Hellwig Tested-by: Christian Borntraeger Reviewed-by: Stefan Haberland Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/partitions/ibm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/block/partitions/ibm.c +++ b/block/partitions/ibm.c @@ -305,8 +305,6 @@ int ibm_partition(struct parsed_partitio if (!disk->fops->getgeo) goto out_exit; fn = symbol_get(dasd_biodasdinfo); - if (!fn) - goto out_exit; blocksize = bdev_logical_block_size(bdev); if (blocksize <= 0) goto out_symbol; @@ -326,7 +324,7 @@ int ibm_partition(struct parsed_partitio geo->start = get_start_sect(bdev); if (disk->fops->getgeo(bdev, geo)) goto out_freeall; - if (fn(disk, info)) { + if (!fn || fn(disk, info)) { kfree(info); info = NULL; } @@ -370,7 +368,8 @@ out_nolab: out_nogeo: kfree(info); out_symbol: - symbol_put(dasd_biodasdinfo); + if (fn) + symbol_put(dasd_biodasdinfo); out_exit: return res; }