From nobody Fri Dec 19 07:47:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F262C6FA8A for ; Tue, 13 Sep 2022 14:20:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232762AbiIMOUm (ORCPT ); Tue, 13 Sep 2022 10:20:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233202AbiIMOSY (ORCPT ); Tue, 13 Sep 2022 10:18:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0982647CA; Tue, 13 Sep 2022 07:13:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 88F6F614A1; Tue, 13 Sep 2022 14:13:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C18EC433D6; Tue, 13 Sep 2022 14:13:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663078402; bh=Xk+ffZi/oa6bLT8bt/QyXdr/GDsumuckqso5rDA4S28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LKamBtO+WszuUvV1cRWlvAURLWryS+1YaYJ8mDtWiawohO+c/FPs4FvUzTd08ccdG yhdR7qAe7a1PwHfV9ooFsX7uyysHNYOe41WJKGnMD0v9ZCjNINxcL5wuuHqB8ej78p Nk01B5mMKDwOiEz1rjwvFXbxX4GnNMZznEQ4IcTs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ming Lei , Christoph Hellwig , Jens Axboe , Sasha Levin Subject: [PATCH 5.19 125/192] block: dont add partitions if GD_SUPPRESS_PART_SCAN is set Date: Tue, 13 Sep 2022 16:03:51 +0200 Message-Id: <20220913140416.230554549@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140410.043243217@linuxfoundation.org> References: <20220913140410.043243217@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Ming Lei [ Upstream commit 748008e1da926a814cc0a054c81ca614408b1b0c ] Commit b9684a71fca7 ("block, loop: support partitions without scanning") adds GD_SUPPRESS_PART_SCAN for replacing part function of GENHD_FL_NO_PART. But looks blk_add_partitions() is missed, since loop doesn't want to add partitions if GENHD_FL_NO_PART was set. And it causes regression on libblockdev (as called from udisks) which operates with the LO_FLAGS_PARTSCAN. Fixes the issue by not adding partitions if GD_SUPPRESS_PART_SCAN is set. Fixes: b9684a71fca7 ("block, loop: support partitions without scanning") Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220823103819.395776-1-ming.lei@redhat.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/partitions/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/partitions/core.c b/block/partitions/core.c index 8a0ec929023bc..76617b1d2d47f 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -597,6 +597,9 @@ static int blk_add_partitions(struct gendisk *disk) if (disk->flags & GENHD_FL_NO_PART) return 0; =20 + if (test_bit(GD_SUPPRESS_PART_SCAN, &disk->state)) + return 0; + state =3D check_partition(disk); if (!state) return 0; --=20 2.35.1