lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <67a40fd8-be26-478f-b8ec-0dc89dc0b140@oracle.com>
Date: Thu, 24 Jul 2025 09:49:45 -0400
From: Chuck Lever <chuck.lever@...cle.com>
To: Jeff Layton <jlayton@...nel.org>,
        Alexander Viro
 <viro@...iv.linux.org.uk>,
        Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
        Steven Rostedt <rostedt@...dmis.org>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        NeilBrown <neil@...wn.name>, Olga Kornievskaia <okorniev@...hat.com>,
        Dai Ngo <Dai.Ngo@...cle.com>, Tom Talpey <tom@...pey.com>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-trace-kernel@...r.kernel.org, linux-nfs@...r.kernel.org
Subject: Re: [PATCH 1/2] vfs: add tracepoints in inode_set_ctime_deleg

On 7/22/25 2:52 PM, Jeff Layton wrote:
> Add tracepoints in inode_set_ctime_deleg() that show the existing ctime,
> the requested ctime and the current_time().
> 
> Signed-off-by: Jeff Layton <jlayton@...nel.org>
> ---
>  fs/inode.c                       |  5 ++++-
>  include/trace/events/timestamp.h | 40 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 44 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/inode.c b/fs/inode.c
> index 99318b157a9a13b3dd8dad0f5f90951f08ef64de..6a8bf57d649aa0909b85f09e3b5b0fbc81efe303 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -2811,10 +2811,13 @@ struct timespec64 inode_set_ctime_deleg(struct inode *inode, struct timespec64 u
>  	cur_ts.tv_sec = inode->i_ctime_sec;
>  
>  	/* If the update is older than the existing value, skip it. */
> -	if (timespec64_compare(&update, &cur_ts) <= 0)
> +	if (timespec64_compare(&update, &cur_ts) <= 0) {
> +		trace_inode_set_ctime_deleg(inode, &cur_ts, &update, NULL);
>  		return cur_ts;
> +	}
>  
>  	ktime_get_coarse_real_ts64_mg(&now);
> +	trace_inode_set_ctime_deleg(inode, &cur_ts, &update, &now);
>  
>  	/* Clamp the update to "now" if it's in the future */
>  	if (timespec64_compare(&update, &now) > 0)
> diff --git a/include/trace/events/timestamp.h b/include/trace/events/timestamp.h
> index c9e5ec930054887a6a7bae8e487611b5ded33d71..e66161d8e14d9b74b0c875f0b324d24895403c18 100644
> --- a/include/trace/events/timestamp.h
> +++ b/include/trace/events/timestamp.h
> @@ -118,6 +118,46 @@ TRACE_EVENT(fill_mg_cmtime,
>  		__entry->mtime_s, __entry->mtime_ns
>  	)
>  );
> +
> +TRACE_EVENT(inode_set_ctime_deleg,
> +	TP_PROTO(struct inode *inode,
> +		 struct timespec64 *old,
> +		 struct timespec64 *req,
> +		 struct timespec64 *now),
> +
> +	TP_ARGS(inode, old, req, now),
> +
> +	TP_STRUCT__entry(
> +		__field(dev_t,		dev)
> +		__field(ino_t,		ino)
> +		__field(time64_t,	old_s)
> +		__field(time64_t,	req_s)
> +		__field(time64_t,	now_s)
> +		__field(u32,		old_ns)
> +		__field(u32,		req_ns)
> +		__field(u32,		now_ns)
> +		__field(u32,		gen)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->dev		= inode->i_sb->s_dev;
> +		__entry->ino		= inode->i_ino;
> +		__entry->gen		= inode->i_generation;
> +		__entry->old_s		= old->tv_sec;
> +		__entry->req_s		= req->tv_sec;
> +		__entry->now_s		= now ? now->tv_sec : 0;
> +		__entry->old_ns		= old->tv_nsec;
> +		__entry->req_ns		= req->tv_nsec;
> +		__entry->now_ns		= now ? now->tv_nsec : 0;
> +	),
> +
> +	TP_printk("ino=%d:%d:%ld:%u old=%lld.%u req=%lld.%u now=%lld.%u",
> +		MAJOR(__entry->dev), MINOR(__entry->dev), __entry->ino, __entry->gen,
> +		__entry->old_s, __entry->old_ns,
> +		__entry->req_s, __entry->req_ns,
> +		__entry->now_s, __entry->now_ns
> +	)
> +);
>  #endif /* _TRACE_TIMESTAMP_H */
>  
>  /* This part must be outside protection */
> 

Reviewed-by: Chuck Lever <chuck.lever@...cle.com>


-- 
Chuck Lever

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ