Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1077751rdg; Wed, 11 Oct 2023 13:51:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFxu/zvuYstj2cAtIt3TVYsgth85xQbFRrwnmbCjAiv2AM1yzuCdAqOP0+ua1V7InOC19Au X-Received: by 2002:a17:903:246:b0:1c0:b84d:3f73 with SMTP id j6-20020a170903024600b001c0b84d3f73mr22728410plh.53.1697057490398; Wed, 11 Oct 2023 13:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697057490; cv=none; d=google.com; s=arc-20160816; b=H/0jQ7dmtTut2+r3j903sm6eYRMU2J+GBuIeNIHSY6gUaDvrmKzMrwZSxlqbAq+LL1 6OU3E0J9e6SXi57tFnKbuUS5+IbxM2K9TlKVuyt+175kFQFRYhuok/BuYUwZuuuCq/Rs w3dpGozACvIJcQyJ5LuAHXInBHG/+r9Tt2srgugF4WYEi9kzoERkJzT+y+QxGdkBAer2 GAy0rV9jVIBSLiYmhTX4iygJdN97CacCbnrKuJMDchVGjP9I8C4kCEEo4FiWq9JMAdTg pnbAlD4ZuugN4MHVGT0UHy8SZ+4R3d6w/MXa5MFGUDVUyQt8z1N51pp1gmfx1ORxu3Ua nyvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=PxitJBHCJQdxtXEDgm6njCHvQtKMi09+y/v+pbWOwa8=; fh=8kGZmCMrEq4pTJCl/FMi8zqJLvmALM/mPQ6jinmCl2E=; b=FNeUwBl/kCL8qSbmItLF72VLgmVXa+yIO8Vk5RgwuNNeuON/VEsN7re+UlFkGRMrZO tziKkCzIHZrSL/0JAfv/BmEQS5egspUAW4Wu1WRDe01nPgZThYf3cNsPI+JIoAQVNEhe V3voUhkm9sMcHC4YM6zZyPWpwS6jkxPSIVjYosCOk1kQZ2KcX8sQYoWTsMh8s4lEIDZY 7qymEjU78mdI1wg2UNdz91he9jL1G6OpKlkvnQlX5hm27XDX7CnJ+mJ+Te1E+L6no5d9 H0bim8yI87z0HT/TVzocbNx4Rk5KXmX3Vkdn9GRu056NGoe++Gfz1JB0aI8iSyhXHqFe V/mw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id z3-20020a170902708300b001bbd639dff9si457392plk.467.2023.10.11.13.51.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 13:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 0C980802F724; Wed, 11 Oct 2023 13:51:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233521AbjJKUvG (ORCPT + 99 others); Wed, 11 Oct 2023 16:51:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233369AbjJKUvF (ORCPT ); Wed, 11 Oct 2023 16:51:05 -0400 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1F1293 for ; Wed, 11 Oct 2023 13:50:31 -0700 (PDT) Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-773ac11de71so15929585a.2 for ; Wed, 11 Oct 2023 13:50:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697057431; x=1697662231; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PxitJBHCJQdxtXEDgm6njCHvQtKMi09+y/v+pbWOwa8=; b=ZXVS/O6ty26HK/4wvF2acZBDkyuKikETOQOKKVt5G2xc7rWX/cdyV69LgSyF6YW/k3 1xTVPYi/49Oqkr59++ecM+myoDtKROwrNT9zA4yEK/hZVUbh9oWyIFuT2oeOXCS2LTsH OFe/BCLm4sooRhL6NQom5Ehjjiwkp7jHjIVWXN//aT8kv6uz0k9UWWk5oZKQDLx4+eHg AbhRfkml0BIfX/acKf775wgJH01FRvUllO9g3KhSGx5mG6G/S7hWmid7ZBI2d3xjkYkl 7YLwfKKX4MfoeAmKcHcqG6Rn2/f+TNmofgoVH0O5YHMRroZXx7QB0H7Q0f2u2OFb+VnP iuOg== X-Gm-Message-State: AOJu0YzMCyLLWokBsdiukS+816unxHQcXaI2Nr1UhuiONLH35RnFxCFE H6bbm/q5xZtwyjj5avawldND X-Received: by 2002:a05:6214:43ca:b0:64f:5261:55e9 with SMTP id oi10-20020a05621443ca00b0064f526155e9mr26910718qvb.41.1697057430888; Wed, 11 Oct 2023 13:50:30 -0700 (PDT) Received: from localhost (pool-68-160-141-91.bstnma.fios.verizon.net. [68.160.141.91]) by smtp.gmail.com with ESMTPSA id 24-20020a05620a06d800b00774830b40d4sm5474922qky.47.2023.10.11.13.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 13:50:30 -0700 (PDT) Date: Wed, 11 Oct 2023 16:50:29 -0400 From: Mike Snitzer To: Jens Axboe Cc: Sarthak Kukreti , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Bart Van Assche , "Darrick J. Wong" , stable@vger.kernel.org, "Darrick J . Wong" , Christoph Hellwig Subject: Re: block: Don't invalidate pagecache for invalid falloc modes Message-ID: References: <20231011201230.750105-1-sarthakkukreti@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=2.6 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 11 Oct 2023 13:51:28 -0700 (PDT) X-Spam-Level: ** On Wed, Oct 11 2023 at 4:20P -0400, Jens Axboe wrote: > On 10/11/23 2:12 PM, Sarthak Kukreti wrote: > > Only call truncate_bdev_range() if the fallocate mode is > > supported. This fixes a bug where data in the pagecache > > could be invalidated if the fallocate() was called on the > > block device with an invalid mode. > > Fix looks fine, but would be nicer if we didn't have to duplicate the > truncate_bdev_range() in each switch clause. Can we check this upfront > instead? No, if you look at the function (rather than just the patch in isolation) we need to make the call for each case rather than collapse to a single call at the front (that's the reason for this fix, because otherwise the default: error case will invalidate the page cache too). Just so you're aware, I also had this feedback that shaped the patch a bit back in April: https://listman.redhat.com/archives/dm-devel/2023-April/053986.html > Also, please wrap commit messages at 72-74 chars. Not seeing where the header should be wrapped. You referring to the Fixes: line? I've never seen those wrapped. Mike