Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4492001pxa; Mon, 10 Aug 2020 10:17:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6D47IsB2Mij7H0L2DZvAKd0ZQHA8Mg2+5TXQ9XJ/TjY5E2gyrkbs3BhNvIf2Dditt8iaO X-Received: by 2002:a17:906:f8c3:: with SMTP id lh3mr23045909ejb.263.1597079872039; Mon, 10 Aug 2020 10:17:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597079872; cv=none; d=google.com; s=arc-20160816; b=qipmFjW5b0bpyz8q6TN2GJvFO99lp6pba/rNkDrXgPD3kh2WMyW6zwDv4yZKo60fbi ofULr+E4Zfdboyh336klfVp/FAlRYOoaI3eJB1aVYRDEh6bzMLY8DRyn/c40M6npcrHK 0OmOO591S9hiw2xeNdNo58b4AoK5XJfcThScncrRnW6b3prwPHvf5miOzld3FscpBibo W1jw6Ozjh42DR8jVtcPYcwxwRi64QeLAHZ3FPS84c3NnlFiecXkbnW/gbZkSkLKuwAO/ 6ov+M1K+zeh3Ii5UNJIZAK1ZMWxjYWcaTQN5hk7ccONTbAsPJWBNI99VfD4l2KtTlCKT jt9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:to:from:date; bh=2sH/DsclxY/hQkBqhDaz/EYMZN+OlD+7bV+uog/lvAQ=; b=rJMKxDBWfOuYaJ4/aZtQiUG1xWBWeJFNSF0iPMRosV+XmRdLZhb+AX5NxHEI2DOgU7 aHA82An9G71hm2alJTSNSJdtQxhjDp0rkL7QwHXmlsVuuPYu3rr7QbMkFIT3R/mkFgkj Heu6BZYhySNsaK/guRPAtIcDGYexaIlTpZwcegHoQyFpEtTsgQSDts6BSHnum0w4Wejs iwXps8l0C15CsLRAsiT9Ahc2iy7ma6bniC/eTG4ZburUtdyWkUInBCeCItWaqXGN+v2b XUk7N7VaB2hAb+547rlauu+Z8Lt2aSpUTbxbtPaF8uz1U87P9WxP2e37wyqNSBkHtzOm OZSA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n3si11645126eji.384.2020.08.10.10.17.29; Mon, 10 Aug 2020 10:17:52 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727921AbgHJRQf (ORCPT + 99 others); Mon, 10 Aug 2020 13:16:35 -0400 Received: from gardel.0pointer.net ([85.214.157.71]:50006 "EHLO gardel.0pointer.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbgHJRQf (ORCPT ); Mon, 10 Aug 2020 13:16:35 -0400 Received: from gardel-login.0pointer.net (gardel.0pointer.net [85.214.157.71]) by gardel.0pointer.net (Postfix) with ESMTP id 80161E814D8; Mon, 10 Aug 2020 19:16:32 +0200 (CEST) Received: by gardel-login.0pointer.net (Postfix, from userid 1000) id 27D4F16081D; Mon, 10 Aug 2020 19:16:32 +0200 (CEST) Date: Mon, 10 Aug 2020 19:16:32 +0200 From: Lennart Poettering To: linux-block , LKML , Jens Axboe , Christoph Hellwig , Yang Xu , Greg Kroah-Hartman Subject: [PATCH v2] loop: unset GENHD_FL_NO_PART_SCAN on LOOP_CONFIGURE Message-ID: <20200810171632.GA226564@gardel-login> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When LOOP_CONFIGURE is used with LO_FLAGS_PARTSCAN we need to propagate this into the GENHD_FL_NO_PART_SCAN. LOOP_SETSTATUS does this, LOOP_CONFIGURE doesn't so far. Effect is that setting up a loopback device with partition scanning doesn't actually work when LOOP_CONFIGURE is issued, though it works fine with LOOP_SETSTATUS. Let's correct that and propagate the flag in LOOP_CONFIGURE too. Fixes: 3448914e8cc5("loop: Add LOOP_CONFIGURE ioctl") Signed-off-by: Lennart Poettering Acked-by: Martijn Coenen --- drivers/block/loop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index d18160146226..2f137d6ce169 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1171,6 +1171,8 @@ static int loop_configure(struct loop_device *lo, fmode_t mode, if (part_shift) lo->lo_flags |= LO_FLAGS_PARTSCAN; partscan = lo->lo_flags & LO_FLAGS_PARTSCAN; + if (partscan) + lo->lo_disk->flags &= ~GENHD_FL_NO_PART_SCAN; /* Grab the block_device to prevent its destruction after we * put /dev/loopXX inode. Later in __loop_clr_fd() we bdput(bdev). -- 2.26.2