Re: [PATCH] btrfs: ratelimit device path change info on mounted device

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

 




Graham, Chris,

I am unable to reproduce, would you be able to try this patch and let me know if this fixes the problem?

Thanks, Anand


On 16/7/19 9:59 PM, Anand Jain wrote:
If there are more than one path to a device, the last scanned path
will map to the mounted FS. In some Linux based os there appears to be a
system script (autofs?) which fails to notice that a device's alternative
path is already mounted, and so the change in device-path gets logged
every ~2mins whenever such a script is active.

kernel: [33017.407252] BTRFS info (device sdc3):
device fsid 4d1ba5af-8b89-4cb5-96c6-55d1f028a202 devid 4 moved
old:/dev/mapper/cryptdata4tb--vg-backup new:/dev/dm-13
kernel: [33017.522242] BTRFS info (device sdc3):
device fsid 4d1ba5af-8b89-4cb5-96c6-55d1f028a202 devid 4 moved
old:/dev/dm-13 new:/dev/mapper/cryptdata4tb--vg-backup
kernel: [33018.797161] BTRFS info (device sdc3):
device fsid 4d1ba5af-8b89-4cb5-96c6-55d1f028a202 devid 4 moved
old:/dev/mapper/cryptdata4tb--vg-backup new:/dev/dm-13
kernel: [33019.061631] BTRFS info (device sdc3):
device fsid 4d1ba5af-8b89-4cb5-96c6-55d1f028a202 devid 4 moved
old:/dev/dm-13 new:/dev/mapper/cryptdata4tb--vg-backup

Fix this by using the ratelimit printk.

Signed-off-by: Anand Jain <anand.jain@xxxxxxxxxx>
Reported-by: g.btrfs@xxxxxxxxxxx
Reported-by: calestyo@xxxxxxxxxxxx
---
  fs/btrfs/volumes.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index a13ddba1ebc3..b4c4add7b5e7 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1086,7 +1086,7 @@ static noinline struct btrfs_device *device_list_add(const char *path,
  				return ERR_PTR(-EEXIST);
  			}
  			bdput(path_bdev);
-			btrfs_info_in_rcu(device->fs_info,
+			btrfs_info_rl_in_rcu(device->fs_info,
  				"device fsid %pU devid %llu moved old:%s new:%s",
  				disk_super->fsid, devid,
  				rcu_str_deref(device->name), path);





[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