Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp192550pxa; Mon, 10 Aug 2020 23:50:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDUO4CJIWd5YjG+KC36zXbd2pU16wBFi4ch2TYXmJnvmeEmNbdGZEtgnhi6BhA3hXqDM87 X-Received: by 2002:a17:906:b815:: with SMTP id dv21mr24654449ejb.517.1597128614372; Mon, 10 Aug 2020 23:50:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597128614; cv=none; d=google.com; s=arc-20160816; b=lNia4/j5+4odiC/HXndQOyGOkfEnxuRlWgqWviybeIrQF82RSWNcGGG5Hbhoa+eI/6 GuFlVJig6Dp3cEeN3MO6tfwcmmCumd01jR17Rj6I0qUIzmqt41Lz6WFYjFATM9K6GH7q NoG0n2poUv7gBMh2jTqgwYCUoyDM3Y5ujnO2JhqWaPWE5acc4nI4ypk41N5b4l5NeTca djQDSvmP6z0D+SVf5Du9FT5PLUp8MNf9TA2q/czrMzI/f4G2C/3fvgeVpUHfZRCU3KMX bjMG10v3NRtPcOXHyIM+8i83H01HW304r4HY1LGMdkgsP0su2rdo2gcAgK7SP81c1MSC b+0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+kY/rAV0FJYGk7hx9T+47Qz9NsD26rE8fB4kuCHrX6E=; b=ZSL2Z/EtzaGcKLXH98YUxGy/9Dk6V2+vc+LsolmXlK0e9RxaS2CKGbna0E/SSi1x5i gRcOd3IKCLhUMnE6oKnoLX50G9b0k2IPkYI3bp81jo9upf9ZbiATUIs55yZOTteyDqFN nKxJ3BS6ImE249hdl792AUGa5psIx4/nU5a8fTanfE1IZFXmDfi10DVN7066Dpk+l4KZ leXcA3kn2D87YMto1KJGXMqE1bgrqoCbVBeJqIpPLS8n3RC9uNGLZ14wbZMx0ymrMBcY wbXbRBAaNkDZYTWT3y/rdc9GkzFmqzs8Ti/dqPcS2eSgmqJINgAuqu/iMo5VKVje1Q4t C3gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=SLDbdUHc; 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=REJECT sp=REJECT dis=NONE) header.from=android.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k21si12409764eje.480.2020.08.10.23.49.51; Mon, 10 Aug 2020 23:50:14 -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=@android.com header.s=20161025 header.b=SLDbdUHc; 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=REJECT sp=REJECT dis=NONE) header.from=android.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728167AbgHKGtR (ORCPT + 99 others); Tue, 11 Aug 2020 02:49:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728045AbgHKGtR (ORCPT ); Tue, 11 Aug 2020 02:49:17 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB2B4C061756 for ; Mon, 10 Aug 2020 23:49:16 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id c15so6072259lfi.3 for ; Mon, 10 Aug 2020 23:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+kY/rAV0FJYGk7hx9T+47Qz9NsD26rE8fB4kuCHrX6E=; b=SLDbdUHcx8Lz3amorc2vV3mxnoUv4wH2iuha7x9WLywq6ZddK3UliJ7LIBWHIbZC+K RC9SspyrF/1/EMS1BmKW3LJBtvbtjre/pIQnVt5tvJv4G8KkhCSQl+SiQ5QWLFqP8dFz +GQMiCaxXytENslyPSE0MYthAbne8eLrBNZBEMepnEaVoVQCHIiiRshA3Xq8P+M4/keW vEH3ntVlCgaCpy0Tk9s5IJW/yplzt0O6V5YcrNhRVStYlgEEovMPgw7lhSLDQoigNt4Q 31Xj5akw+VcjbZCnpYqD7iOypB1xqVtYidW/WxjudZ+mO2Zo4K3PohnMzHZ7MCenzYk9 LVmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+kY/rAV0FJYGk7hx9T+47Qz9NsD26rE8fB4kuCHrX6E=; b=BLr6+KL/M/kMP7sOBW3v4ES6R5WiupVcGlW9CKtrbQHBsSIhd1Ep0rVsVPJZrdV6Ew CEFsiuyjiFRv3qS0ok8t3ga4QrnKOMsZwFyeYbMXqOdGy/4qOrJREWZesUFkVlVYOvOk MEzXXRd5horPUtMkMkvS1EUb8eQrbJtOGM0OMv1CjXCFGKMMv0YvRba6tdkKZs9rvYwG 2tzpCicQ8IUYPNI1RU9ZF3+zzOmKpiWJ0kB2aH1Dj4Nlb1o5IHJNlLxr3EcNZ354EEQz alaX2n6fA8va6QUFVuHmcJHAJnCO/V6ZAvMQvpSKIm/yg2scDXYFhiIQLkvJFdKc8sdJ hd1g== X-Gm-Message-State: AOAM5316f8e7g9LetUwP29Kd36ubjGkmLh96YG2qH/5PYjpi0Q2ZqahK 9Tfw804Xe40wGbP+jJSyYeyFCoocOnqqepAFoOyEog== X-Received: by 2002:a05:6512:20c1:: with SMTP id u1mr2460052lfr.17.1597128554916; Mon, 10 Aug 2020 23:49:14 -0700 (PDT) MIME-Version: 1.0 References: <20200810171632.GA226564@gardel-login> In-Reply-To: <20200810171632.GA226564@gardel-login> From: Martijn Coenen Date: Tue, 11 Aug 2020 08:49:03 +0200 Message-ID: Subject: Re: [PATCH v2] loop: unset GENHD_FL_NO_PART_SCAN on LOOP_CONFIGURE To: Lennart Poettering Cc: linux-block , LKML , Jens Axboe , Christoph Hellwig , Yang Xu , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 10, 2020 at 7:16 PM Lennart Poettering wrote: > > 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 Thanks, still looks good to me. > --- > 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