Re: [PATCH 1/2] btrfs: open code log helpers in device_list_add()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux