Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1086852rdg; Wed, 11 Oct 2023 14:09:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGI8y5flrGrDiXuOq6j1E5PJvwiSREkxmwaBfKC/itFXhHrG7lxz+PjFbI2aJb9fJRTuUII X-Received: by 2002:a05:6870:c6a4:b0:1b0:3637:2bbe with SMTP id cv36-20020a056870c6a400b001b036372bbemr27450756oab.54.1697058560819; Wed, 11 Oct 2023 14:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697058560; cv=none; d=google.com; s=arc-20160816; b=xu/a+7Ii/TPYH97CDIBDnV5m3diRbsQ5ViaLX0QzHKNLb8cZojP9vOzEa0caXzt0gT Rh4MVFyKL4iaUvKUNNEoLLfoMpbi/raZptYpYsIcXEE+t4ZuIZj8CflTqp8yUVdWweBx f66Xcy8/N9tmWOy07ZuA/K441M68IMuamvstziIRLh52IfXnZNiOhusb3pKFrgKyMr6f w9SDdTXBMlzYKk7xTiUd4Qv48KrwNyjOJsgSvlYYF/Vb1pVS1kJDMJtHTMIh0PNBI1SC SmCvo+iz3YHK9u0yod2lRiiSCN6bt4CC/24Ds3MQcI5NLlI5O0pYpKCFNYFydH6fnrWA OWbQ== 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=6vFhMHCh6uUl8avUdhvw8MzdlyCHTFfcctmbku9CIHU=; fh=8kGZmCMrEq4pTJCl/FMi8zqJLvmALM/mPQ6jinmCl2E=; b=N2Jbz+QNIVw+z+AVXiCHOnv9XcyvYiCDuEyZNc+p9bCHRex9NlOr5rulx1ZwR/34TN YAWlrz2+w5rorOxWq0P5P/PbtnG+o3L14CxNt0+l19m1YXvi6Oomd3FDKNNlR9i89thg UvU7HYlEMU5MhiHXBb1G1QkMd1PPaDAwhfIkV2fiTza3CPDAFXX6+AfXwU4KRWFR8yyu 1ETUvL49MyRRYrxbFdM8GN0pRcejP25tm6ilnDPwS7aP5UR8pBtTqvIXRnub1yPoHs2C RDArvVXgfSHZqpR5tUKzDqcwBoxmgLtoGTWLeCVoGDxYQMEjBzC2nRQGILg0Q+ce90d9 oTSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id d17-20020a056a00199100b0068e29a05fa4si13453851pfl.326.2023.10.11.14.09.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 14:09:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 4ED238072453; Wed, 11 Oct 2023 14:09:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233369AbjJKVJM (ORCPT + 99 others); Wed, 11 Oct 2023 17:09:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231912AbjJKVJL (ORCPT ); Wed, 11 Oct 2023 17:09:11 -0400 Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9B0F90 for ; Wed, 11 Oct 2023 14:08:23 -0700 (PDT) Received: by mail-yb1-f174.google.com with SMTP id 3f1490d57ef6-d77ad095f13so261253276.2 for ; Wed, 11 Oct 2023 14:08:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697058503; x=1697663303; 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=6vFhMHCh6uUl8avUdhvw8MzdlyCHTFfcctmbku9CIHU=; b=QmbidjCqDQ20pVwR51nBt+Zo+PR6AUTeqaEUf/Sbo8Zctb+S3gwpfye4dFwdbrLcLt z0S9v2Wk1y7kPaUejakr0y0LeOebmMlEJdmZ0Jx2fI7MyCM1U4ZJfCThAzFunRKTXnOQ M0VE5vllX9fIB4oRutWr78nRY7S4zmR902kiCxS4Yv6Ixx8xXtLaN5jv0bUQqZ67MrP8 +48Z2ZGfmDTq7ukZJOa4Y4RAfTWa0sYFpIcraoiVnZfrCgd5Gm5seMeKyLxB7sOTrPen ae23eITx33duX+l2RKGuGKSHwkS3HAoviVi9aFNqpMx1AJ+t0BRB4mfJRAKhx6I3lZQd L6bg== X-Gm-Message-State: AOJu0YyZZLaFAohZgyZfx94qcWXfpg9ToJjh2DjaIFp/c67OSQTV2QJA KkkJ5LjsK3kIEs8fhBVtSSLJV9dPEMB7610+1w== X-Received: by 2002:a25:aaad:0:b0:d9a:526a:2514 with SMTP id t42-20020a25aaad000000b00d9a526a2514mr6479268ybi.62.1697058502868; Wed, 11 Oct 2023 14:08:22 -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 d7-20020a0cb2c7000000b0064f5d70d072sm6049114qvf.37.2023.10.11.14.08.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 14:08:22 -0700 (PDT) Date: Wed, 11 Oct 2023 17:08:21 -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 morse.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 (morse.vger.email [0.0.0.0]); Wed, 11 Oct 2023 14:09:18 -0700 (PDT) X-Spam-Level: ** On Wed, Oct 11 2023 at 4:53P -0400, Jens Axboe wrote: > On 10/11/23 2:50 PM, Mike Snitzer wrote: > > 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). > > Yes that part is clear, but it might look cleaner to check a valid mask > first rather than have 3 duplicate calls. OK. > > 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. > > I'm referring to the commit message itself. Ah, you'd like lines extended because they are too short.