Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1160434pxa; Thu, 6 Aug 2020 00:42:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEmDslcJvbdWU/9IM2rfHbZ30myJVWGRvnbhEQS5pyRmPO/lD227bkDH+Mglv7ck9LrSqD X-Received: by 2002:a17:906:e46:: with SMTP id q6mr3078792eji.234.1596699774990; Thu, 06 Aug 2020 00:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596699774; cv=none; d=google.com; s=arc-20160816; b=o1xVoxE63YXQEUMqDYjI+RZHRUz+MRDq/fhdPnwm/rCJeQCAGhs5zW0vS5DLqMrYnE 92WNpIbp7RnBomLrhMfAl2tGMZHFF/VV1jgnHBL9v/BoVdZZVzsOJ7vo8kkfvSM7vmdE LkO38WFkWu5oVoqz209zQGi2l9fPpTRidgD7p9tRB5wcnGwSFlBoJhmUDpyQQHf2JikK gMFfN35LkVnNt5hvXViLXp5ViDlmSiHW277HbdZvangaLv/02ejogObW2J+32JjZJ82I QboXn47hkV2fh4TQWMKmTgD/JlXsFjLQesNAMny5Szc7rvKR/HluFImir+k3aEcRF5Jp PvDw== 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:cc:to:from:date; bh=nQmPIGjceXcyOw3E2DwWr/t3CQmdPVaOWktaxSlnznE=; b=oXhaob/apcodWQCVgT1yRfeqdKptOO1ktlN9Pvk9Ap81nXtSNRmhsotQ/qmOfHvYyw TuIRMg4Pb37N2TfIWlcCf6cf2dzZyls0VCpZKBg/WZn7bdqZyijiXn7xc3G/l96SnBqG i1gaq7OWE/DQp6Mh9UAenEj6nKUgXGO9DV7IplyC+mNFhZgWotZ/KL+l3E9LyrFfEFl+ TUL00LNxwxudOot7zv3uS0QQgUl9z/s3O4/MeC4mRJ9uDziVzHg8YJcSSsmkfWw7ZBvs alBk88C/LOa39brMFOucLABBPVabf1hIwQALwqvD4axqVCilDG4w/UMjxATvCd4wgqHv q/7Q== 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 g22si1684744ejx.196.2020.08.06.00.42.32; Thu, 06 Aug 2020 00:42:54 -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 S1728605AbgHFHmM (ORCPT + 99 others); Thu, 6 Aug 2020 03:42:12 -0400 Received: from gardel.0pointer.net ([85.214.157.71]:46328 "EHLO gardel.0pointer.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728430AbgHFHmE (ORCPT ); Thu, 6 Aug 2020 03:42:04 -0400 X-Greylist: delayed 567 seconds by postgrey-1.27 at vger.kernel.org; Thu, 06 Aug 2020 03:42:03 EDT Received: from gardel-login.0pointer.net (gardel.0pointer.net [85.214.157.71]) by gardel.0pointer.net (Postfix) with ESMTP id 66C94E80643; Thu, 6 Aug 2020 09:32:22 +0200 (CEST) Received: by gardel-login.0pointer.net (Postfix, from userid 1000) id CB059160D57; Thu, 6 Aug 2020 09:32:21 +0200 (CEST) Date: Thu, 6 Aug 2020 09:32:21 +0200 From: Lennart Poettering To: Martijn Coenen Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe , Christoph Hellwig Subject: [PATCH] loop: unset GENHD_FL_NO_PART_SCAN on LOOP_CONFIGURE Message-ID: <20200806073221.GA219724@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_SETSTATUS too. Signed-off-by: Lennart Poettering --- 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