public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Goldwyn Rodrigues <rgoldwyn@suse.de>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: use inode->i_sb to calculate fs_info
Date: Tue, 10 Feb 2026 09:49:07 +1030	[thread overview]
Message-ID: <b8afd522-7170-46f0-9c98-0fb7e4dbcfa8@gmx.com> (raw)
In-Reply-To: <djynzzkwdfzqq6rks5njvhjexmje2zoofffkx2qtectxlyv53f@r54cgbf5l2b3>



在 2026/2/10 05:41, Goldwyn Rodrigues 写道:
> If overlay is used on top of btrfs, dentry->d_sb translates to overlay's
> super block and fsid assignment will lead to a crash.
> 
> Use inode->i_sb to calculate btrfs_sb.
> 
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
>   include/trace/events/btrfs.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
> index 125bdc166bfe..94a197557382 100644
> --- a/include/trace/events/btrfs.h
> +++ b/include/trace/events/btrfs.h
> @@ -772,7 +772,7 @@ TRACE_EVENT(btrfs_sync_file,
>   		const struct dentry *dentry = file->f_path.dentry;
>   		const struct inode *inode = d_inode(dentry);
>   
> -		TP_fast_assign_fsid(btrfs_sb(file->f_path.dentry->d_sb));
> +		TP_fast_assign_fsid(btrfs_sb(inode->i_sb));
>   		__entry->ino		= btrfs_ino(BTRFS_I(inode));
>   		__entry->parent		= btrfs_ino(BTRFS_I(d_inode(dentry->d_parent)));
>   		__entry->datasync	= datasync;


  parent reply	other threads:[~2026-02-09 23:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-09 19:11 [PATCH] btrfs: use inode->i_sb to calculate fs_info Goldwyn Rodrigues
2026-02-09 21:44 ` Boris Burkov
2026-02-09 23:19 ` Qu Wenruo [this message]
2026-02-24 16:57 ` David Sterba
2026-02-24 17:01   ` Filipe Manana
2026-02-24 17:13     ` David Sterba

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=b8afd522-7170-46f0-9c98-0fb7e4dbcfa8@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=rgoldwyn@suse.de \
    /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