Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6201027rwr; Mon, 24 Apr 2023 15:45:39 -0700 (PDT) X-Google-Smtp-Source: AKy350ZBEnZpHOQgqhjT+S7PDwBQW4i+aWwXz/VFRJXxR8Ur0yLR0DsaxpCzZTbUHhIsh3VPT0Ta X-Received: by 2002:a17:90b:1c0b:b0:246:8193:1fdc with SMTP id oc11-20020a17090b1c0b00b0024681931fdcmr15381053pjb.3.1682376339603; Mon, 24 Apr 2023 15:45:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682376339; cv=none; d=google.com; s=arc-20160816; b=roRvjVMCuEbFRivvZAFQrGAJpIK3aWLRJUg1PIYoIuf0wobGbaHIhMVK/k0GwY1mVo UsYWN1TBVAwTI6PASs0C4AX+Q7+9xnsLh+eA/jVb+BNPJDr+EStzURHqe+k8OUdZtI9F ANskS5xlzMjQVZ4HixUnktsGFeIVelyefUiQ0uWoGVCBPHjC/Qb06q9TR96aGoUoK7Si 3E/AJz1sPdyR71znaNJe1wN5rA1z2u6xJxaqDi5hdI0/tK5gC2bR88aJcXk3qKDzoTRq ykNeRB5fOoEdyFKcW9lWQIAZUJ38WYNHOBl7loi26xv3e/V3gDHXH3WH45+L7q1AcAF3 x42g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=feM04i0/6vRuC/hd4QJiH2jTDvSUCiEV+H+qsq5ng/c=; b=qQD5xhGJ9XT8vDlxxSF4I/84bg5DZ7OpvVjslDc2hIdEb/CnRLK60BiZNlXtG30jYU +ivzRH6B1chdHyobbruFxBfL916icokxu2WPl6VR5iyN6wXzucznSDj9+uPe0Y4qr0s1 eLR/vIkAf9BB5b30A+GNAWE7No4HU1cqFkca0qVMLM+iQqKxZFy7wYKu3Ej1hQiGZcwe rvlC8VYydMM9LH2JtI04wTMKZ7D+raQZlWDjGUhe4KhsnB2XyXFr8yVKZn/BGwuI1e7K ICiM265S16dpX6OqoGtfD5/wtBSMAlITzT+poTTH+SrH2xu2cbdbEvzXFY4MDhDqG61s Qxkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=jG+djohD; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=HVvj5Jq4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n127-20020a632785000000b0050c0cdce84asi13144321pgn.577.2023.04.24.15.45.24; Mon, 24 Apr 2023 15:45:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=jG+djohD; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=HVvj5Jq4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232987AbjDXWkb (ORCPT + 99 others); Mon, 24 Apr 2023 18:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbjDXWka (ORCPT ); Mon, 24 Apr 2023 18:40:30 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D95E665BD; Mon, 24 Apr 2023 15:40:28 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 4189A21940; Mon, 24 Apr 2023 22:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1682376027; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=feM04i0/6vRuC/hd4QJiH2jTDvSUCiEV+H+qsq5ng/c=; b=jG+djohD8LGJypEysxreNq4J8bODv9nphYXo5fWEF17C4/Gp3msq4EBRjGFKymD74WWmPm IOpO3GfwWAxh82FJ48B0HmTHg0BPLqY64nj52Ce3TDPCAKWFmAPUv1JXkEDyZkSUIlV5bB 1XMM9ghroU4WStNf9bzrRWgcT1esNc0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1682376027; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=feM04i0/6vRuC/hd4QJiH2jTDvSUCiEV+H+qsq5ng/c=; b=HVvj5Jq4rjhdr0M094REXU/pQH9kVDhjtHdES+sbOskKKlCDCStXvr1hjWGjcnxMTOEX// RzBOPSkmJFiWP+AA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9E7FC13780; Mon, 24 Apr 2023 22:40:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CBiBFVYFR2QwSwAAMHmgww (envelope-from ); Mon, 24 Apr 2023 22:40:22 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Jeff Layton" Cc: "Alexander Viro" , "Christian Brauner" , "Darrick J. Wong" , "Hugh Dickins" , "Andrew Morton" , "Dave Chinner" , "Chuck Lever" , "Jan Kara" , "Amir Goldstein" , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH v2 1/3] fs: add infrastructure for multigrain inode i_m/ctime In-reply-to: <404a9a8066b0735c9f355214d4eadf0d975b3188.camel@kernel.org> References: <20230424151104.175456-1-jlayton@kernel.org>, <20230424151104.175456-2-jlayton@kernel.org>, <168237287734.24821.11016713590413362200@noble.neil.brown.name>, <404a9a8066b0735c9f355214d4eadf0d975b3188.camel@kernel.org> Date: Tue, 25 Apr 2023 08:40:19 +1000 Message-id: <168237601955.24821.11999779095797667429@noble.neil.brown.name> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 25 Apr 2023, Jeff Layton wrote: > On Tue, 2023-04-25 at 07:47 +1000, NeilBrown wrote: > > On Tue, 25 Apr 2023, Jeff Layton wrote: > > > + /* > > > + * Warn if someone sets SB_MULTIGRAIN_TS, but doesn't turn down the ts > > > + * granularity. > > > + */ > > > + return (sb->s_flags & SB_MULTIGRAIN_TS) && > > > + !WARN_ON_ONCE(sb->s_time_gran == 1); > > > > Maybe > > !WARN_ON_ONCE(sb->s_time_gran & SB_MULTIGRAIN_TS); > > ?? > > > > I'm not sure I understand what you mean here. That's fair, as what I wrote didn't make any sense. I meant to write: !WARN_ON_ONCE(sb->s_time_gran & I_CTIME_QUERIED); to make it explicit that s_time_gran must leave space for I_CTIME_QUERIED to be set (as you write below). Specifically that s_time_gran mustn't be odd. > We want to check whether > SB_MULTIGRAIN_TS is set in the flags, and that s_time_gran > 1. The > latter is required so that we have space for the I_CTIME_QUERIED flag. > > If SB_MULTIGRAIN_TS is set, but the s_time_gran is too low, we want to > throw a warning (since something is clearly wrong). > NeilBrown