Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30638376rwd; Thu, 6 Jul 2023 08:37:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlHinp2qQ87vVOUB/5fYPwUA/1v5HA6KyadBMy0t9p/8YEiTKAOcsvf87JlEm5upj78M23ov X-Received: by 2002:a05:6a20:a897:b0:125:a674:de24 with SMTP id ca23-20020a056a20a89700b00125a674de24mr1331219pzb.42.1688657838576; Thu, 06 Jul 2023 08:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688657838; cv=none; d=google.com; s=arc-20160816; b=yHXl/jArgLLW3GDhu9JVe7BoINt5i0UX2Du4OWuGFr39rai5eYirdI7Iq2LSCK9d5i jYm8BucLIHcfsbvtGTTVxiNKt9i73i5GBTyW9ig+bvDgtfyVX/fy9FCLmywqisK/MyHv 7YVgBoAPgvZ7GLmJT2MEyY0ecHnt/8i08pAd2iWhzNZF3TtoZtTIOyV1AYJtQ0ZBXPlq r1D3+sCzJLIVTqT4zxA0qUGrw8YeMAfiJe0mEOXsqXQrLY/r+VqWmVeHt4FkV52KJPu+ QzIGZ+lbovvThCl0/XbS9cjj/xzLlrKW26iMnYvI73ijxg+/rVAc78w3Kv2nXP4YXsDJ JAeA== 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=NJEM6bD3baXfKwVmrUUZvxYT3AKqRBG+HXOO4JRx2k0=; fh=dTspbDgepisTEpyyrAfsyUwRJ1Ro/+wW/qSyBG6P/vY=; b=m4NyBbMVEZ1yrUF8g1W40FaNdfC1Dx1rX0J0BQei1kKhu7VfGOJYLgGqETOgGsF/gD lsaXKjaY4EJUik39+YlIigACb3PvaVKPg/NQlsMv8vA2m0Go+g7ro2tuX25uKRWy9T4S OmNuHb+DnzWZVdAjNaoJqyCwJgQV1AZU723kZnrQGcJ4J9sLs//QMjs9Ad0HBWjiKn7/ XMQ0bNzMgoISFoGEZ5oJnQQA+0oNSU/x1f7pixUV7Gs3RWVcIRYf1FnbBE5B4+8EeAf0 0MmC0lOO8+SaqVazkE50MtGB4k6zghzGzXXyPJkxQBwJN39fgMdG26XJ7s5Sta5gC1Hu L0Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=P6Fui+t4; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 x21-20020a17090300d500b001b3dacdf717si1376250plc.608.2023.07.06.08.37.04; Thu, 06 Jul 2023 08:37:18 -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=P6Fui+t4; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 S233653AbjGFO5Z (ORCPT + 99 others); Thu, 6 Jul 2023 10:57:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233640AbjGFO5Y (ORCPT ); Thu, 6 Jul 2023 10:57:24 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FF671BFD; Thu, 6 Jul 2023 07:57:13 -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 D95081F88F; Thu, 6 Jul 2023 14:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1688655431; 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=NJEM6bD3baXfKwVmrUUZvxYT3AKqRBG+HXOO4JRx2k0=; b=P6Fui+t4vyteVR038WrkFSmdUkghFdvgIPL13ylpec9zRRxuuIdZPsch9fWFrjaLfj6c1/ gBTJXEe+iRDhXv/I3gZct5M/9bT9p9WJPtjPibW6hvnmzP3lZcUYxHgxm7sNHhXOiplhC1 MHhnN8DKKOJAreIorTawfZI6C8xHle4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1688655431; 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=NJEM6bD3baXfKwVmrUUZvxYT3AKqRBG+HXOO4JRx2k0=; b=EHsWZw93r7MnEk131Nf6ZZrIx0Ar3jCQjLdBqNT4Dj/cgWVA7OZgiOLowuFnasJWAXWOOI hlwMbfUTl9rlokCg== 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 C7232138FC; Thu, 6 Jul 2023 14:57:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KVWQMEfWpmTDBQAAMHmgww (envelope-from ); Thu, 06 Jul 2023 14:57:11 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 525C1A0707; Thu, 6 Jul 2023 16:57:11 +0200 (CEST) Date: Thu, 6 Jul 2023 16:57:11 +0200 From: Jan Kara To: Jeff Layton Cc: Christian Brauner , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" , Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org Subject: Re: [PATCH v2 89/92] apparmor: convert to ctime accessor functions Message-ID: <20230706145711.qq6lpczp5zjv7lva@quack3> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> <20230705190309.579783-87-jlayton@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230705190309.579783-87-jlayton@kernel.org> 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 Wed 05-07-23 15:01:54, Jeff Layton wrote: > In later patches, we're going to change how the inode's ctime field is > used. Switch to using accessor functions instead of raw accesses of > inode->i_ctime. > > Signed-off-by: Jeff Layton Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > security/apparmor/apparmorfs.c | 6 +++--- > security/apparmor/policy_unpack.c | 4 ++-- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c > index 3d0d370d6ffd..7dbd0a5aaeeb 100644 > --- a/security/apparmor/apparmorfs.c > +++ b/security/apparmor/apparmorfs.c > @@ -226,7 +226,7 @@ static int __aafs_setup_d_inode(struct inode *dir, struct dentry *dentry, > > inode->i_ino = get_next_ino(); > inode->i_mode = mode; > - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); > + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); > inode->i_private = data; > if (S_ISDIR(mode)) { > inode->i_op = iops ? iops : &simple_dir_inode_operations; > @@ -1557,7 +1557,7 @@ void __aafs_profile_migrate_dents(struct aa_profile *old, > if (new->dents[i]) { > struct inode *inode = d_inode(new->dents[i]); > > - inode->i_mtime = inode->i_ctime = current_time(inode); > + inode->i_mtime = inode_set_ctime_current(inode); > } > old->dents[i] = NULL; > } > @@ -2546,7 +2546,7 @@ static int aa_mk_null_file(struct dentry *parent) > > inode->i_ino = get_next_ino(); > inode->i_mode = S_IFCHR | S_IRUGO | S_IWUGO; > - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); > + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); > init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO, > MKDEV(MEM_MAJOR, 3)); > d_instantiate(dentry, inode); > diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c > index ed180722a833..8b8846073e14 100644 > --- a/security/apparmor/policy_unpack.c > +++ b/security/apparmor/policy_unpack.c > @@ -89,10 +89,10 @@ void __aa_loaddata_update(struct aa_loaddata *data, long revision) > struct inode *inode; > > inode = d_inode(data->dents[AAFS_LOADDATA_DIR]); > - inode->i_mtime = inode->i_ctime = current_time(inode); > + inode->i_mtime = inode_set_ctime_current(inode); > > inode = d_inode(data->dents[AAFS_LOADDATA_REVISION]); > - inode->i_mtime = inode->i_ctime = current_time(inode); > + inode->i_mtime = inode_set_ctime_current(inode); > } > } > > -- > 2.41.0 > -- Jan Kara SUSE Labs, CR