public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris Burkov <boris@bur.io>
To: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: use inode->i_sb to calculate fs_info
Date: Mon, 9 Feb 2026 13:44:37 -0800	[thread overview]
Message-ID: <20260209214437.GB379757@zen.localdomain> (raw)
In-Reply-To: <djynzzkwdfzqq6rks5njvhjexmje2zoofffkx2qtectxlyv53f@r54cgbf5l2b3>

On Mon, Feb 09, 2026 at 02:11:37PM -0500, Goldwyn Rodrigues wrote:
> 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.
> 

I'd prefer the commit title to note the fact that its a tracepoint, but
that's fully a nit.

Reviewed-by: Boris Burkov <boris@bur.io>

> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
> ---
>  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;
> -- 
> 2.53.0

  reply	other threads:[~2026-02-09 21:45 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 [this message]
2026-02-09 23:19 ` Qu Wenruo
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=20260209214437.GB379757@zen.localdomain \
    --to=boris@bur.io \
    --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