Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp791740rwo; Wed, 2 Aug 2023 04:24:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlEapN/FkS3p+fVXapEXNu56KA0YcXioNgBHhafjQyMAaepKtKg2tUJvrsmAfFNw60//rDlX X-Received: by 2002:aa7:d805:0:b0:522:aa7b:1543 with SMTP id v5-20020aa7d805000000b00522aa7b1543mr5141710edq.11.1690975485575; Wed, 02 Aug 2023 04:24:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690975485; cv=none; d=google.com; s=arc-20160816; b=fom44fHVlm4/IkIKehrY9lOK9+hXALqZ3ZRde9TRBFfeWf63TGf1nykKl1b4fHGkJI uSI+wqSGwKTDBr5hFSUDi8bb+dSQjncG9IUrMenuf+Z/JwjGsXobwIwJDupeiUfiQdwb czi6vBpwFnRDTJSgTYKNhiqPs65Fsf53eEZeULoiRc4AQ2s5kbJtmL3GMU65IquMKA82 02qbfV6EjkFXnZJAOyOTHIonfQSNf6ksS3XXUfUiNIPOlYMZ73fngg4ZI+jSOop+qcV3 tIVv4gFY/Lq/u3DV5OpjXIH7tpr88SZMC+/EgRL3NVn0aBz644eAuzTH/UPgHoCmeu1V +qLg== 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:dkim-signature :dkim-signature; bh=MR58NMBglJtxUxpSgzfkjnZorzDEMsBbaguIyc3mpKs=; fh=iTZ9Yv99/2N1udYO0E7IGQtLJuqwQw0p6lVJXXLTDqw=; b=Srx24ckcRScBbvKZ/+6StE62jIrOyXsspBDFxZ+s9l0Q1cHo2tMK5yA5RdktLsETFq vDlq5ZzXk2am/K+Sd57SSCVLGJKR+LI0L1JIyD1JTK4ev6xcaHZELhCcOeJm3hEjiTmc lye36pJ0oi0PR2jsaHAYBHhjvU5TVq66mr7ThN5OhfX62VyR3IVumlmvXBjUnksDTJQK vm8xOqWXcePTEqqyacOWmgyvOWKx6bohSbWbGY+0Rz6EzrNwcCRr42HrdZTr53MMEw1L Mvs+jnO7cVE4iOKYvRPYtApO8+eVk9xBukMVZKpn20mhGIrEfXF+TdWu7yqhCNgsI2uG ua7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=TmbFmgfw; dkim=neutral (no key) header.i=@suse.cz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a19-20020aa7d753000000b00522d78e6dfesi3408622eds.388.2023.08.02.04.24.20; Wed, 02 Aug 2023 04:24:45 -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.cz header.s=susede2_rsa header.b=TmbFmgfw; dkim=neutral (no key) header.i=@suse.cz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232708AbjHBKij (ORCPT + 99 others); Wed, 2 Aug 2023 06:38:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232480AbjHBKiM (ORCPT ); Wed, 2 Aug 2023 06:38:12 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD2254682; Wed, 2 Aug 2023 03:34:24 -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-out2.suse.de (Postfix) with ESMTPS id 764A41F747; Wed, 2 Aug 2023 10:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1690972463; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MR58NMBglJtxUxpSgzfkjnZorzDEMsBbaguIyc3mpKs=; b=TmbFmgfwfLg9UiwJyY4spbAzOMrXavHMXBOiqxAIOwPFBgpM+LJm0+qmZCaBUIZGCDTGrE fRg903IGUjPcrRFNtuZGT0D6u3CFXvgSqDTTPtmfR20P33YAX5EhhQgEwLKGstRMxY8IYP /WQZ2vIFg4FibpaKv4AS/V3BxxqhZxE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1690972463; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MR58NMBglJtxUxpSgzfkjnZorzDEMsBbaguIyc3mpKs=; b=ErQJZxwi/4DRe4LY5xycNVKcu6lQanAV3vJzTxo1eJ/06fLw6ANa8v4Z0yYYiLNgvvT/f4 Ns5BsunpYqjDacCg== 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 6847113919; Wed, 2 Aug 2023 10:34:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id V9VqGS8xymSDCgAAMHmgww (envelope-from ); Wed, 02 Aug 2023 10:34:23 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id EAB7CA076B; Wed, 2 Aug 2023 12:34:22 +0200 (CEST) Date: Wed, 2 Aug 2023 12:34:22 +0200 From: Jan Kara To: Jeff Layton Cc: Theodore Ts'o , Andreas Dilger , Jan Kara , Christian Brauner , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Hugh Dickins Subject: Re: [PATCH] ext4: fix the time handling macros when ext4 is using small inodes Message-ID: <20230802103422.lzgb7yyksfbpw4rh@quack3> References: <20230718-ctime-v1-1-24e2f96dcdf3@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230718-ctime-v1-1-24e2f96dcdf3@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 18-07-23 13:31:59, Jeff Layton wrote: > If ext4 is using small on-disk inodes, then it may not be able to store > fine grained timestamps. It also can't store the i_crtime at all in that > case since that fully lives in the extended part of the inode. > > 979492850abd got the EXT4_EINODE_{GET,SET}_XTIME macros wrong, and would > still store the tv_sec field of the i_crtime into the raw_inode, even > when they were small, corrupting adjacent memory. > > This fixes those macros to skip setting anything in the raw_inode if the > tv_sec field doesn't fit, and to properly return a {0,0} timestamp when > the raw_inode doesn't support it. > > Cc: Jan Kara > Fixes: 979492850abd ("ext4: convert to ctime accessor functions") > Reported-by: Hugh Dickins > Signed-off-by: Jeff Layton I've seen Christian has already folded this fixup so I just want to say: Thanks for fixing this up while I was away! Honza -- Jan Kara SUSE Labs, CR