Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2617467ybz; Mon, 27 Apr 2020 00:46:18 -0700 (PDT) X-Google-Smtp-Source: APiQypJnbaEMRPDEXk9bgT4w9JVBighZdXHghy2GMFRfE6utN836iRH5+HZ90l9m8ksgwZvcf53B X-Received: by 2002:a05:6402:1773:: with SMTP id da19mr17370262edb.2.1587973578825; Mon, 27 Apr 2020 00:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587973578; cv=none; d=google.com; s=arc-20160816; b=MpOrhQr0wT+K8UUS95tSJARkOpZ0HRm5K42E9DiIGv+Y+Rdrgu6Ld+eBuWGrmybMX+ FP+SDcGr0AUSvVKfnvnzix2e+jhsXFwhRS7DIYhb0T5CL9rGdhcizQ0aQ4iHmdJCNEJ2 kL0bSQ+p0hYVWxtFTEB0Jkkujs08o8cR6Xk8mFcKScsfYxMtDT4Pjns0Sb+8GyytJIrh uf5PtXZXBf4zRU7RUMoLvLF+w4bNoXsY/KLfut2wLP5CRu781CuzEf6acWbPdu+1DHo2 jKaeB/w+Ya80OqAYyMonicxO9zSQa2yPRIWKmJAcpFnwcQccrw6cLNaEj8GyXDaTxNGb ZU+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8xcqA+A5T/eSVdFtVfWGXjYGiqSe96zXgzrOUnJqE+k=; b=RrgXt78TAqyGBfc7bqbNfoSB/n6HilArBuMGFR6XM7BqoAL/n2hSB5sz1DrhLukqym ZYPwIday4z5Bd3FesyoE7YKgSC5gM91QZ8FNeAdH2kq9rcZf8NG+MF+QN2kS39ewowvw /wPFSDCL1pyB3Apsf+inCb/X5iIVogKXCIghdwPzVlcs9luYwbpeUQvl/5joE/UI8XGx ZDJFbBC3QQsle9Q7dE+WbcCiZf4NVbsGY20/uiBipUaTZC4RRPYem10g/3gUr4CCDy3C Nf6AxlyVMadEZR+AY7W88d6Y9klwGfkfH6ibDq/QmrNqC2GZShR4z9JiaoS4OLRZd0Zp UhJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=qiWr5IRy; 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 do15si9141580ejc.95.2020.04.27.00.45.55; Mon, 27 Apr 2020 00:46:18 -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=qiWr5IRy; 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 S1726753AbgD0Hmn (ORCPT + 99 others); Mon, 27 Apr 2020 03:42:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726685AbgD0Hmi (ORCPT ); Mon, 27 Apr 2020 03:42:38 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 333D8C061A0F for ; Mon, 27 Apr 2020 00:42:38 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id v8so15256904wma.0 for ; Mon, 27 Apr 2020 00:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8xcqA+A5T/eSVdFtVfWGXjYGiqSe96zXgzrOUnJqE+k=; b=qiWr5IRyG5B4RKrJoDDtT8SjaYb8O6m4vlG/UDbEJ+kzh9zuT8Kr48zBapp3HkOhdt c/b7+BF3iGfc6P/0+/VJSbLn1rBPNWxkB1Mt92wUX/UR4JSxKE0g2SjorK89CNnzZuqe xeGdXtKQ4IjckhaETkRgjTP4x2Xf0qutb2DD6Ha81BDA2YynHDUQpauF4So5yeP1uKng 7/ZaauHsfmDsK9Skv1adaZEg6pN7W00u/ftK1FybB5FymVSnUyTfhQC2TbtH3/G26gxw 0V+WKXeEoUijb53PjRyjSH5fBlR0/nrD/hw2PVJAmiz4veXYrbEPNLgbvS016EpWgMET F5CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8xcqA+A5T/eSVdFtVfWGXjYGiqSe96zXgzrOUnJqE+k=; b=rLCn1bMawTeFcH2D1Jr3nAU32YX4+BKZDO9mQvCpRl+1pLzSu0pHQjqF5vZbrUCM32 lUcirXfn8ip4N4+IFprbXt82ovzZ61lSviaQQ0OXihp6x6Ss8j8DT4cDBpUSkd8zrRYv QGMvxQr4cUUrr/x4kHYf9VC+J4xjBe40AQ+exFNfwu3oStmmNFqVCXYZdtHTENL3oUcO Ier1BD+njfyoBpDW3YiB3FiyHYMK6l2hwbPI+0vsZP8hYalsCrWuJe3K1Tq9xfHX8OG9 DqVervWETT4Qxlvp6iYw33FC27hnLK0gETQbAGKFUSR5cvL3V2Ywq4el5+A/XJkFpNVZ SUxg== X-Gm-Message-State: AGi0PubUZG+AtbmsuAarIkoX9RK0rpIccV4mdFEvg0SAkALaFvwM8Gng SdaMM6PcBkFk18QWhG19TfRFeQ== X-Received: by 2002:a1c:f418:: with SMTP id z24mr24440234wma.122.1587973357000; Mon, 27 Apr 2020 00:42:37 -0700 (PDT) Received: from maco2.ams.corp.google.com (a83-162-234-235.adsl.xs4all.nl. [83.162.234.235]) by smtp.gmail.com with ESMTPSA id x132sm15091658wmg.33.2020.04.27.00.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 00:42:36 -0700 (PDT) From: Martijn Coenen To: axboe@kernel.dk, hch@lst.de, ming.lei@redhat.com Cc: narayan@google.com, zezeozue@google.com, kernel-team@android.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, maco@google.com, bvanassche@acm.org, Chaitanya.Kulkarni@wdc.com, jaegeuk@kernel.org, Martijn Coenen Subject: [PATCH v3 3/9] loop: Switch to set_capacity_revalidate_and_notify() Date: Mon, 27 Apr 2020 09:42:16 +0200 Message-Id: <20200427074222.65369-4-maco@android.com> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog In-Reply-To: <20200427074222.65369-1-maco@android.com> References: <20200427074222.65369-1-maco@android.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This was recently added to block/genhd.c, and takes care of both updating the capacity and notifying userspace of the new size. Signed-off-by: Martijn Coenen --- drivers/block/loop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 4630d098cc54..2e2874318393 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -253,10 +253,10 @@ static void loop_set_size(struct loop_device *lo, loff_t size) { struct block_device *bdev = lo->lo_device; - set_capacity(lo->lo_disk, size); bd_set_size(bdev, size << SECTOR_SHIFT); + /* let user-space know about the new size */ - kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, KOBJ_CHANGE); + set_capacity_revalidate_and_notify(lo->lo_disk, size, false); } static int -- 2.26.2.303.gf8c07b1a785-goog