Linux Trace Kernel
 help / color / mirror / Atom feed
From: liubaolin <liubaolin12138@163.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: almaz.alexandrovich@paragon-software.com, mhiramat@kernel.org,
	mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org,
	ntfs3@lists.linux.dev, linux-trace-kernel@vger.kernel.org,
	liubaolin12138@gmail.com, Baolin Liu <liubaolin@kylinos.cn>
Subject: Re: [PATCH v3 v3 5/7] ntfs3: add allocation tracepoints
Date: Wed, 19 Aug 2026 16:39:14 +0800	[thread overview]
Message-ID: <69b2de59-f2cf-4c26-aa97-909117eabf15@163.com> (raw)
In-Reply-To: <20260811162127.5f98eadb@gandalf.local.home>

Dear Steven,
    Thanks for your review. You are right, I will fix it as suggested in v4.


Thanks,
Baolin

在 2026/8/12 04:21, Steven Rostedt 写道:
> Also Sashiko had something to say about this patch: https://sashiko.dev/#/patchset/20260807010354.2277156-8-liubaolin12138%40163.com
> 
>> --- Patch [5]: [PATCH v3 v3 5/7] ntfs3: add allocation tracepoints ---
>> commit 0592c540bc564c346cb524c624f6ee4a5768406b
>> Author: Baolin Liu <liubaolin@kylinos.cn>
>>
>> ntfs3: add allocation tracepoints
>>
>> This commit adds trace events for ntfs3 allocation operations. It introduces
>> events for attr_allocate_clusters, attr_set_size_ex, and attr_data_get_block
>> to help observe cluster allocation, size changes, and block mapping activity.
>>
>>> diff --git a/include/trace/events/ntfs3.h b/include/trace/events/ntfs3.h
>>> index 4ac05ed29e49d..d16dd127ff2e5 100644
>>> --- a/include/trace/events/ntfs3.h
>>> +++ b/include/trace/events/ntfs3.h
>> [ ... ]
>>> +TRACE_EVENT(ntfs3_attr_set_size_ex,
>>> +	TP_PROTO(struct inode *inode, u32 type, u64 new_size, bool keep_prealloc,
>>> +		 bool no_da),
>>> +	TP_ARGS(inode, type, new_size, keep_prealloc, no_da),
>>> +	TP_STRUCT__entry(
>>> +		__field(loff_t, old_size)
>>> +		__field(u64, new_size)
>>> +		__field(unsigned long, ino)
>>> +		__field(dev_t, dev)
>>> +		__field(u32, type)
>>> +		__field(bool, keep_prealloc)
>>> +		__field(bool, no_da)
>>> +	),
>>> +	TP_fast_assign(
>>> +		__entry->old_size = i_size_read(inode);
>>
>> Will this actually record the previous size during truncate operations?
>>
>> When an application truncates a file, the VFS size is often updated before
>> calling into the filesystem. For instance, looking at how ntfs_setattr()
>> handles this:
>>
>> fs/ntfs3/file.c:ntfs_setattr() {
>>          ...
>>          truncate_setsize(inode, newsize);
>>          
>>          err = ntfs_set_size(inode, newsize);
>>          ...
>> }
>>
>> Since truncate_setsize() updates the VFS inode size before attr_set_size_ex()
>> and this tracepoint are reached, won't i_size_read(inode) just return the
>> newly truncated size, resulting in old_size equaling new_size?
>>
>> Could the actual old size be passed as an explicit parameter to the
>> tracepoint instead of sampling it here?
>>
>>> +		__entry->new_size = new_size;
>>> +		__entry->ino = inode->i_ino;
>>> +		__entry->dev = inode->i_sb->s_dev;
>>> +		__entry->type = type;
>>> +		__entry->keep_prealloc = keep_prealloc;
>>> +		__entry->no_da = no_da;
>>> +	),
>> [ ... ]
> 
> -- Steve


  reply	other threads:[~2026-08-19  8:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07  1:03 [PATCH v3 v3 0/7] ntfs3: add tracepoints for core filesystem paths Baolin Liu
2026-08-07  1:03 ` [PATCH v3 v3 1/7] ntfs3: add mount and log replay tracepoints Baolin Liu
2026-08-07  1:03 ` [PATCH v3 v3 2/7] ntfs3: add namei tracepoints Baolin Liu
2026-08-07  1:03 ` [PATCH v3 v3 3/7] ntfs3: add create inode tracepoint Baolin Liu
2026-08-07  1:03 ` [PATCH v3 v3 4/7] ntfs3: add directory index tracepoints Baolin Liu
2026-08-07  1:03 ` [PATCH v3 v3 5/7] ntfs3: add allocation tracepoints Baolin Liu
2026-08-11 20:04   ` Steven Rostedt
2026-08-19  8:38     ` liubaolin
2026-08-11 20:21   ` Steven Rostedt
2026-08-19  8:39     ` liubaolin [this message]
2026-08-07  1:03 ` [PATCH v3 v3 6/7] ntfs3: add iomap tracepoints Baolin Liu
2026-08-07  1:03 ` [PATCH v3 v3 7/7] ntfs3: add file I/O tracepoints Baolin Liu
2026-08-07  1:07 ` [PATCH v3 v3 0/7] ntfs3: add tracepoints for core filesystem paths liubaolin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=69b2de59-f2cf-4c26-aa97-909117eabf15@163.com \
    --to=liubaolin12138@163.com \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=liubaolin12138@gmail.com \
    --cc=liubaolin@kylinos.cn \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=ntfs3@lists.linux.dev \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox