Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp536403ybk; Wed, 13 May 2020 06:40:59 -0700 (PDT) X-Google-Smtp-Source: APiQypKYf33aCFP2wtynd95h85BAgMdwmUwGD+r6OV2rj9ORqltCmqoTbLhxXuEdGMErkrNiaV7q X-Received: by 2002:a17:906:f74e:: with SMTP id jp14mr23307695ejb.15.1589377259409; Wed, 13 May 2020 06:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589377259; cv=none; d=google.com; s=arc-20160816; b=L7CmNn6MgKklYIN1ATyU0uykHdQyP/mV3emNfh2V4ud34qQbHxb8lSuTunkMCBFLcZ 1vLVwaufJgs58b5D13VJnWl+6q5oec+5/UyQrN0mNCcXTfD5Aqp+MQ74THrZ+ycb6X7n RI+rAMETkrbpr7LjdmnRkC/2pHizvEWy35RqYwG4cMzX3Hw842hEaLwheXE+j/OZ4+FQ 2RWIKpDO5nIWIXNpG7r7ENf7Tv1fU/Rjd6yRPc+AL9Iwu9UbCQxlZPzN1VAF3uRy4J4c wVVJ8mjrn+/Iz0QtQ7bfQVKUpehKDFVRpxzi5K9r38cokD3Fk5KWA4HXMIqVqXjeuu1g 17hw== 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=e1sTXqRGguAy+llg7dGLJYj6/VWdX40SKxOhmoNPZP0=; b=dUIP/NOSF1MjfsTD1mbF3mm9AfXuGt0A7Aj/aO2UXMG4+37rTeLugMnGTQt3Gg9VeN 4T1brPcmm0NWigPIrJHw3LUVMbkQMJxiKRnDi9r7u+VNAUSeBO/IioCPqrhOzxrKeXdl 3hG08An54n4dBZTGX5kL7jOqRLiNi7ud/zEoeCgZaAFIVCBSZbI3EMLVTlcvSTsoivEq 4HtQ7qgS6HsTt6fuxOt1NvxbNW3qZ4N+kQ+VfJvQipEngdoRoERE0HCghOpFmCjEyol0 0wN0PxgAby+M2Bki7O15CgHjaxlVsTjltV7d7hB3NZUnaGF425/l0N39+gCtCM74cOS4 aLoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=TL34dow3; 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 c3si9524363eja.251.2020.05.13.06.40.36; Wed, 13 May 2020 06:40:59 -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=TL34dow3; 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 S2388412AbgEMNjE (ORCPT + 99 others); Wed, 13 May 2020 09:39:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388310AbgEMNi7 (ORCPT ); Wed, 13 May 2020 09:38:59 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D551BC05BD09 for ; Wed, 13 May 2020 06:38:58 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id l17so7381448wrr.4 for ; Wed, 13 May 2020 06:38:58 -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=e1sTXqRGguAy+llg7dGLJYj6/VWdX40SKxOhmoNPZP0=; b=TL34dow3AFECXbJ22HTyK9KKsX1QdBLwrxktF/YGJpH66oiAUsx7m2rSbf4mCCs9hF EKiFq6v7JUV8pbTRNRzyQnks+IUVQHjODPEWyzMhtxz9+TuVguf5lZmFyjKiwEHZOiSm tfII4L7jNTinj5cOB6qyKXFZwCAUv86HZgmazcxq5qiBwQTOy8O4AA7A5rZ53w/H3fuT QxFD4l2FAMJHWSUU5Z3C/ujQjAux3oO8X/oM02mUh7nUSTEjdm8xq9bCMZ8g1iXs9cjd 2mQPyA6X7tC7DWS7nDgyEh6Rw/gwO8+aHyjeKa/mWri0IRS2H5XbWhghK874x1RGkCcI 1Cyw== 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=e1sTXqRGguAy+llg7dGLJYj6/VWdX40SKxOhmoNPZP0=; b=mz1KcA4n4Oq48b/cE4MSRhngeiKeeh3dquO/UTC+hWR+TY0e03rLDP74aZOnBSEmk6 q1ItFd7KZV2m5Iz3fNnln//JAUr3i0usjUtmuLm7wC/akB+3kQrc2o+M9k9iLGHLuqin y2bWC1njXGV0tIG54cHY/fJc0FEiURKTJIkvK/02KSDzYLsAAb3bZji0PgKCwBMgTUr7 jtI10W1IY1AtxMk4pt5xkLenx50DRygZUnRru/u5/MMBQi2RBy8mIy3qhpGk9IXglM9A vtNfqID5VxBg5BcyNFP7McEsHLE/LDJ4EYKa/irdpdJvM0FfyDCz/YJN5QDrPcF6o4sr CT4g== X-Gm-Message-State: AGi0PuaZYORZbeCxVAR2/QV4dMl/ljOJFjM+oIgPRqRFy/wnauSPLYVj edp9QIo7m/MeQrPOE9FQS/ixFg== X-Received: by 2002:adf:e951:: with SMTP id m17mr25514589wrn.352.1589377134532; Wed, 13 May 2020 06:38:54 -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 m6sm26202653wrq.5.2020.05.13.06.38.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 06:38:53 -0700 (PDT) From: Martijn Coenen To: axboe@kernel.dk, hch@lst.de, ming.lei@redhat.com Cc: narayan@google.com, zezeozue@google.com, maco@google.com, kernel-team@android.com, bvanassche@acm.org, Chaitanya.Kulkarni@wdc.com, jaegeuk@kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Martijn Coenen Subject: [PATCH v5 04/11] loop: Switch to set_capacity_revalidate_and_notify() Date: Wed, 13 May 2020 15:38:38 +0200 Message-Id: <20200513133845.244903-5-maco@android.com> X-Mailer: git-send-email 2.26.2.645.ge9eca65c58-goog In-Reply-To: <20200513133845.244903-1-maco@android.com> References: <20200513133845.244903-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. Reviewed-by: Christoph Hellwig Signed-off-by: Martijn Coenen --- drivers/block/loop.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index e69ff3c19eff..d9a756f8abd5 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -240,10 +240,9 @@ 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 void -- 2.26.2.645.ge9eca65c58-goog