Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	David Sterba <dsterba@suse.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	Anand Jain <anand.jain@oracle.com>,
	"syzbot+582e66e5edf36a22c7b0@syzkaller.appspotmail.com" 
	<syzbot+582e66e5edf36a22c7b0@syzkaller.appspotmail.com>
Subject: Re: [PATCH] btrfs: don't access possibly stale fs_info data for printing duplicate device
Date: Thu, 12 Nov 2020 14:25:19 +0200	[thread overview]
Message-ID: <469df3f6-33bd-e725-a3fb-ac77ca852149@suse.com> (raw)
In-Reply-To: <SN4PR0401MB35987501AB13F33A9498D85D9BE70@SN4PR0401MB3598.namprd04.prod.outlook.com>



On 12.11.20 г. 14:09 ч., Johannes Thumshirn wrote:
> On 12/11/2020 13:03, Nikolay Borisov wrote:
>> Would a simple 'if()' here catch the case where fs_info is not
>> initialized essentially open-coding what Anand has proposed? My idea is
>> to be able to provide the filesystem id when we can (best effort) and
>> simply use pr_warn otherwise, but without having to change the internals
>> of btrfs_printk and instead handle the single problematic call site ?
>>
> 
> Unfortunately not, I've been trying to do that but the device->fs_info pointer
> exists and accessing it triggers a KASAN splat.
> 
> Actually btrfs_printk() is already checking if fs_info is NULL or not to decide
> whether to print <unknown> or fs_info->sb->s_id.
> 
> Another option would be to do btrfs_warn_in_rcu(NULL but that doesn't buy us a lot
> more.
> 

Indeed, so I'm fine to proceed with this simpler code.

  reply	other threads:[~2020-11-12 12:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12 11:59 [PATCH] btrfs: don't access possibly stale fs_info data for printing duplicate device Johannes Thumshirn
2020-11-12 12:02 ` Nikolay Borisov
2020-11-12 12:09   ` Johannes Thumshirn
2020-11-12 12:25     ` Nikolay Borisov [this message]
2020-11-13 16:53     ` David Sterba
2020-11-13 16:57       ` David Sterba
2020-11-13 18:41         ` Johannes Thumshirn
2020-11-13 18:45           ` Johannes Thumshirn

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=469df3f6-33bd-e725-a3fb-ac77ca852149@suse.com \
    --to=nborisov@suse.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=anand.jain@oracle.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=syzbot+582e66e5edf36a22c7b0@syzkaller.appspotmail.com \
    /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