Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5223615pxj; Tue, 22 Jun 2021 18:40:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwt8SkBcTXh5Ue89gwyPAvmoLusbITu9bHQWlSui7M/smKrSaFif2gOQ/1JqSR0PiMGNjr0 X-Received: by 2002:a17:906:4a96:: with SMTP id x22mr7014611eju.20.1624412418725; Tue, 22 Jun 2021 18:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624412418; cv=none; d=google.com; s=arc-20160816; b=uPNouKRo4n0aiJA45TETlrkCNCn83MxDH7qKrqEm0nbBCCITiiSlEKwDtc3RJ0FpU2 EQ1B4wme/77Qy9mjdDf7ijE+TrKAU6k8+7PBvlbpkjg8s8Kswtgfu8D/ye1RlZhnMxtA HFD8DX0xnFNadqnX2WMTq6cQJUnboO+ak+ZhaVjaWJVy/2g9Fb65FrYuZU2kSP5E72Qx 5YcXXMKfwLZoxWIk5J4J7jC0jHcTQKP+y0S/W3HdTHwyT42eUqhlbKcOcYocyS5WuZKc T+T+vt1ZL/fj2F2fBbQZaX1GU2WP0l66q+tJRhyvQFk4I4pTINXp2xELrlGTdN3/+fxc F9ow== 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=xFKh226JEYXM4CWBG1x8GCr2yIjs6iHm3MBNzFEFvZI=; b=YIpE8LsDewNFXVGuJUf5WNyFuXAOUPjgzeChOPH/BclM5h18dX6gNlfW3TBRJrqDFX YcFEULqtZ+Ugk0gTAJvS0fykD1UsX4IC2CCk/VD3nXJv6ie4ENalUlJZTRahNf4x6PN2 wLof+ppegH8cu24NtxD36Y3r5ZtrxOzODGl01V0lT5Xfk/jn+TDFl5iairEuKnNslH+3 VAc1xOczA5yh4Lp3PsTf8Zn4/8o4efaEVzEfFH7T8IUOtIcQzKKfd4bynVSfHnGTN0rt tiY4LsnSXyj6ftVQ40jhKLXsFz7FCiS7hA7fKeyBvSNYkdkFx1vFMI0f2l4eM+r/ZIsN QeDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si6977720edw.330.2021.06.22.18.39.56; Tue, 22 Jun 2021 18:40:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbhFWBjA (ORCPT + 99 others); Tue, 22 Jun 2021 21:39:00 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:49588 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229774AbhFWBjA (ORCPT ); Tue, 22 Jun 2021 21:39:00 -0400 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 15N1adH0031867 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Jun 2021 21:36:40 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 5FF4915C3CD6; Tue, 22 Jun 2021 21:36:39 -0400 (EDT) Date: Tue, 22 Jun 2021 21:36:39 -0400 From: "Theodore Ts'o" To: Leah Rumancik Cc: linux-ext4@vger.kernel.org Subject: Re: [PATCH v5 1/3] ext4: add discard/zeroout flags to journal flush Message-ID: References: <20210518151327.130198-1-leah.rumancik@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210518151327.130198-1-leah.rumancik@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, May 18, 2021 at 03:13:25PM +0000, Leah Rumancik wrote: > Add a flags argument to jbd2_journal_flush to enable discarding or > zero-filling the journal blocks while flushing the journal. > > Signed-off-by: Leah Rumancik > > Changes in v4: > - restructured code division between patches > - changed jbd2_journal_flush flags arg from bool to unsigned long long > > Changes in v5: > - changed jbd2_journal_flush flags to unsigned int > - changed name of jbd2_journal_flush flags from JBD2_ERASE* to > JBD2_JOURNAL_FLUSH* > - cleaned up loop in jbd2_journal_erase which finds contiguous regions > - updated flag checking > --- I noticed a minor issue in this commit, and so I've made the following change to this commit in the ext4 tree. - Ted diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 521ce41c242c..3a2ed60ea8b7 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1715,7 +1715,7 @@ static int __jbd2_journal_erase(journal_t *journal, unsigned int flags) if (!q) return -ENXIO; - if (JBD2_JOURNAL_FLUSH_DISCARD & !blk_queue_discard(q)) + if ((flags & JBD2_JOURNAL_FLUSH_DISCARD) && !blk_queue_discard(q)) return -EOPNOTSUPP; /*