All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/2] btrfs: open code log helpers in device_list_add()
Date: Tue, 14 Jan 2020 13:15:31 +0800	[thread overview]
Message-ID: <01be0d25-e7e6-663e-3e49-82a248e7cc1e@oracle.com> (raw)
In-Reply-To: <20200113162521.GW3929@twin.jikos.cz>

On 14/1/20 12:25 AM, David Sterba wrote:
> On Sat, Jan 11, 2020 at 07:41:51AM +0800, Anand Jain wrote:
>>>>    			if (device->bdev != path_bdev) {
>>>>    				bdput(path_bdev);
>>>>    				mutex_unlock(&fs_devices->device_list_mutex);
>>>> -				btrfs_warn_in_rcu(device->fs_info,
>>>> -			"duplicate device fsid:devid for %pU:%llu old:%s new:%s",
>>>> +				rcu_read_lock();
>>>> +				printk_ratelimited(
>>>
>>> Avoiding fs_info here is correct but we don't want to use raw printk or
>>> printk_ratelimited anywhere.
>>>
>>
>>    I think I discussed this a long time back, that we should rather pass
>>    fs_devices in btrfs_warn_in_rcu().
>>
>>    I am ok to make such a change, are you ok?
> 
> No, this does not sound right at all. Why should be btrfs_warn_in_rcu
> special from the other message callbacks? We need to fix one context, so
> let's find something less hacky.
> 
>>    Or I wonder if there is
>>    any other way?
> 
> We could add a fs_info stub that will get recognized in btrfs_printk.
> Eg.
> 
> #define	NO_FS_INFO		((void*)0x1)
> 
> btrfs_printk() {
> 
> 	if (fs_info == NULL)
> 		devname = "<unknown>";
> 	else if (fs_info == NO_FS_INFO)
> 		devname = "...";
> 	else
> 		devname = fs_info->sb->sb_id;
> 

Yeah it makes sense to me. Patches sent.

Thanks, Anand

      reply	other threads:[~2020-01-14  5:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10  9:05 [PATCH 1/2] btrfs: open code log helpers in device_list_add() Anand Jain
2020-01-10  9:05 ` [PATCH 2/2] btrfs: make the scan logs consistent Anand Jain
2020-01-10 16:42 ` [PATCH 1/2] btrfs: open code log helpers in device_list_add() David Sterba
2020-01-10 23:41   ` Anand Jain
2020-01-13 16:25     ` David Sterba
2020-01-14  5:15       ` Anand Jain [this message]

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=01be0d25-e7e6-663e-3e49-82a248e7cc1e@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.