Skip to content

[Deepin-Kernel-SIG] [linux 6.6.y] [Upstream] Sync xfs code clean from v6.17-rc1#1711

Open
opsiff wants to merge 13 commits into
deepin-community:linux-6.6.yfrom
opsiff:linux-6.6.y-2026-05-14-xfs
Open

[Deepin-Kernel-SIG] [linux 6.6.y] [Upstream] Sync xfs code clean from v6.17-rc1#1711
opsiff wants to merge 13 commits into
deepin-community:linux-6.6.yfrom
opsiff:linux-6.6.y-2026-05-14-xfs

Conversation

@opsiff
Copy link
Copy Markdown
Member

@opsiff opsiff commented May 14, 2026

Summary by Sourcery

Clean up and streamline XFS tracepoints to match upstream, including config-guarding compat ioctl traces and dropping unused or obsolete events.

Enhancements:

  • Guard the XFS compat ioctl inode tracepoint with CONFIG_COMPAT to align with configuration options.
  • Remove unused or obsolete XFS trace events related to direct write completion, page cache invalidation, allocation, attribute handling, reflink operations, copy-on-write ENOSPC handling, log I/O, and attribute state returns to reduce tracepoint noise and maintenance overhead.

rostedt added 13 commits May 14, 2026 15:12
mainline inclusion
from mainline-v6.17-rc1
category: bugfix

When the function xfs_attri_remove_iter was removed, it did not remove the
trace event that it called. As a trace event can take up to 5K of memory for
text and meta data regardless of if it is used or not, remove this unused trace
event.

Fixes: 59782a2 ("xfs: remove xfs_attri_remove_iter")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
(cherry picked from commit 091e945)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
mainline inclusion
from mainline-v6.17-rc1
category: bugfix

The trace event xlog_iclog_want_sync was added but never used. As trace
events can take up around 5K of memory in text and meta data regardless if
they are used or not, remove this unused event.

Fixes: 956f6da ("xfs: add iclog state trace events")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
(cherry picked from commit 32177ab)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
mainline inclusion
from mainline-v6.17-rc1
category: bugfix

The trace event xfs_ioctl_clone was added but never used. As trace events
can take up to 5K of memory in text and meta data regardless if they are
used or not, remove the unused trace event.

Fixes: 53aa1c3 ("xfs: define tracepoints for reflink activities")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
(cherry picked from commit 6f7080b)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
mainline inclusion
from mainline-v6.17-rc1
category: bugfix

When the clone/dedupe_file_rang common functions were refactored, it
removed the calls to the xfs_reflink_compare_extents and
xfs_reflink_compare_extents_error events. As each event can take up to 5K
in memory for text and meta data regardless if they are used or not, they
should not be created if they are not used. Remove these unused events.

Fixes: 876bec6 ("vfs: refactor clone/dedupe_file_range common functions")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
(cherry picked from commit 8c54845)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
mainline inclusion
from mainline-v6.17-rc1
category: bugfix

When the function xfs_attr_rmtval_set() was removed, the call to the
corresponding trace event was also removed but the trace event itself was
not. As trace events can take up to 5K of memory in text and meta data
regardless if they are used or not they should not be created when not
used. Remove the unused trace event.

Fixes: 0e6acf2 ("xfs: Remove xfs_attr_rmtval_set")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
(cherry picked from commit b3b5015)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
mainline inclusion
from mainline-v6.17-rc1
category: bugfix

Trace events can take up to 5K in memory for text and meta data per event
regardless if they are used or not, so they should not be defined when not
used. The events xfs_attr_fillstate and xfs_attr_refillstate are only
called in code that is #ifdef out and exists only for future reference.

Remove these unused events. If the code is needed again, then git history
can recover what the events were.

Suggested-by: Christoph Hellwig <hch@lst.de>
Fixes: 59782a2 ("xfs: remove xfs_attri_remove_iter")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
(cherry picked from commit b54480c)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
mainline inclusion
from mainline-v6.17-rc1
category: bugfix

When xfs_attri_remove_iter() was removed, so was the call to the trace
event xfs_attr_node_removename. As trace events can take up to 5K in
memory for text and meta data regardless if they are used or not, they
should not be created when unused. Remove the unused event.

Fixes: 59782a2 ("xfs: remove xfs_attri_remove_iter")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
(cherry picked from commit ea26bbc)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
mainline inclusion
from mainline-v6.17-rc1
category: bugfix

Trace events take up to 5K of memory in text and meta data regardless if
they are used or not. The call to the event xfs_alloc_near_error was
removed when the cursor data structure allocation was introduced. Remove
it as it is no longer used and is just wasting memory.

Fixes: f5e7dbe ("xfs: introduce allocation cursor data structure")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
(cherry picked from commit 237f8e8)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
mainline inclusion
from mainline-v6.17-rc1
category: bugfix

When the function xfs_alloc_space_available() was restructured, it removed
the only calls to the trace event xfs_alloc_near_nominleft. As trace
events take up to 5K of memory for text and meta data for each event, they
should not be created when not used. Remove this unused event.

Fixes: 54fee13 ("xfs: adjust allocation length in xfs_alloc_space_available")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
(cherry picked from commit f110060)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
mainline incluion
from mainline-v6.17-rc1
category: bugfix

When the function xfs_flushinval_pages() was removed, it removed the only
caller to the trace event xfs_pagecache_inval. As trace events can take up
to 5K of memory in text and meta data each regardless if they are used or
not, they should not be created when unused. Remove the unused event.

Fixes: fb59581 ("xfs: remove xfs_flushinval_pages")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
(cherry picked from commit 88fd451)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
mainline inclusion
from mainline-v6.17-rc1
category: bugfix

When the use of iomap_dio_rw was added, the calls to the trace events
xfs_end_io_direct_unwritten and xfs_end_io_direct_append were removed but
those trace events were not. As trace events can take up to 5K in memory
for text and meta data regardless if they are used or not, they should not
be created when not used. Remove the unused events.

Fixes: acdda3a ("xfs: use iomap_dio_rw")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
(cherry picked from commit 9a8a536)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
…nfigure

mainline inclusion
from mainline-v6.17-rc1
category: bugfix

The trace event xfs_file_compat_ioctl is only used when CONFIG_COMPAT is
configured in the build. As trace events can take up to 5K in memory for
text and meta data regardless if they are used, they should not be created
when unused. Add #ifdef CONFIG_COMPAT around the event so that it is only
created when that is configured.

Fixes: cca28fb ("xfs: split xfs_itrace_entry")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
(cherry picked from commit 31b98ef)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
mainline inclusion
from mainline-v6.17-rc1
categroy: bugfix

The call to the event xfs_reflink_cow_enospc was removed when the COW
handling was merged into xfs_file_iomap_begin_delay, but the trace event
itself was not. Remove it.

Fixes: db46e60 ("xfs: merge COW handling into xfs_file_iomap_begin_delay")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
(cherry picked from commit 75fe259)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 14, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR syncs XFS tracepoint definitions in xfs_trace.h with upstream by dropping unused or removed trace events and guarding a compat-only inode trace event with CONFIG_COMPAT, keeping the trace set aligned with current kernel behavior.

Flow diagram for CONFIG_COMPAT-guarded xfs_file_compat_ioctl trace event

flowchart LR
    A[xfs_trace_h] --> B[Check CONFIG_COMPAT]
    B -->|enabled| C[DEFINE_INODE_EVENT xfs_file_compat_ioctl]
    B -->|disabled| D[No xfs_file_compat_ioctl tracepoint]
    C --> E[Kernel build includes compat ioctl tracing]
    D --> F[Kernel build omits compat ioctl tracing]
Loading

File-Level Changes

Change Details Files
Guard the compat ioctl inode trace event with CONFIG_COMPAT to match its code usage.
  • Wrap DEFINE_INODE_EVENT(xfs_file_compat_ioctl) in an #ifdef CONFIG_COMPAT / #endif pair
  • Ensure the tracepoint is only built when compat ioctl support is enabled
fs/xfs/xfs_trace.h
Remove obsolete or upstream-removed XFS trace events to align with the v6.17-rc1 trace set.
  • Drop direct-IO completion trace events xfs_end_io_direct_write_unwritten and xfs_end_io_direct_write_append
  • Remove the xfs_pagecache_inval TRACE_EVENT definition
  • Remove several allocation-related trace events such as xfs_alloc_near_nominleft and xfs_alloc_near_error
  • Drop unused XFS attribute trace events including xfs_attr_node_removename, xfs_attr_fillstate, xfs_attr_refillstate, and xfs_attr_rmtval_set
  • Remove reflink-related trace events such as dedupe compare, cow ENOSPC, and xfs_ioctl_clone
  • Remove xlog_iclog_want_sync and xfs_attr_remove_iter_return state trace events
fs/xfs/xfs_trace.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • After removing these trace events, double-check that there are no remaining references (e.g., tracepoints names in debug helpers, scripts, or tracepoint class reuse) that would now cause build or runtime issues.
  • For the new CONFIG_COMPAT guard around xfs_file_compat_ioctl, verify that the declaration and any call sites are consistently guarded in the same way to avoid mismatched symbol availability in different build configurations.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- After removing these trace events, double-check that there are no remaining references (e.g., tracepoints names in debug helpers, scripts, or tracepoint class reuse) that would now cause build or runtime issues.
- For the new CONFIG_COMPAT guard around xfs_file_compat_ioctl, verify that the declaration and any call sites are consistently guarded in the same way to avoid mismatched symbol availability in different build configurations.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Avenger-285714
Copy link
Copy Markdown
Member

/approve

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Avenger-285714

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR streamlines XFS tracepoint declarations to align with upstream cleanup for Linux 6.17-rc1.

Changes:

  • Guards xfs_file_compat_ioctl tracepoint declaration behind CONFIG_COMPAT.
  • Removes unused or obsolete XFS trace event declarations across IO, allocation, attr, reflink, and log paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants