Bug 1216914 - [btrfs] Warning message in syslog during sending snapshot (/fs/btrfs/send.c:7400 btrfs_ioctl_send)
Summary: [btrfs] Warning message in syslog during sending snapshot (/fs/btrfs/send.c:7...
Status: NEW
Alias: None
Product: PUBLIC SUSE Linux Enterprise Server 15 SP5
Classification: openSUSE
Component: Kernel (show other bugs)
Version: unspecified
Hardware: x86-64 Other
: P3 - Medium : Major
Target Milestone: ---
Assignee: Kernel Bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-06 16:28 UTC by Mikhail Feoktistov
Modified: 2023-11-06 16:41 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Archive with log and script to reproduce the bug (44.51 KB, application/x-zip-compressed)
2023-11-06 16:28 UTC, Mikhail Feoktistov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Feoktistov 2023-11-06 16:28:25 UTC
Created attachment 870653 [details]
Archive with log and script to reproduce the bug

OS: SUSE Linux Enterprise Server 15 sp5 (sp4 is also affected)
CPU: amd_x64
Hdd with root btrfs.

Bug description:
I'm trying to make a series of backups of a btrfs root subvolume.
There is a warning message in syslog from "btrfs send" process.
This message appears when sending difference between parent and child snapshots.
It happens starting from the third and the following snapshots.

How to Reproduce:
I'll prepare a simple script to reproduce the bug.

1. Prepare the host with two HDD
sda with root fs
sdb mounted to /mnt for the backups

sda      8:0    0   20G  0 disk
├─sda1   8:1    0    8M  0 part
├─sda2   8:2    0 18.6G  0 part /var
│                               /home
│                               /boot/grub2/i386-pc
│                               /tmp
│                               /root
│                               /usr/local
│                               /srv
│                               /opt
│                               /boot/grub2/x86_64-efi
│                               /.snapshots
│                               /
└─sda3   8:3    0  1.4G  0 part [SWAP]
sdb      8:16   0   30G  0 disk /mnt

2. Run the script

3. You will see the warning in /var/log/messages

2023-11-06T18:28:43.156068+01:00 localhost kernel: [13781.549694][ T3171] WARNING: CPU: 2 PID: 3171 at ../fs/btrfs/send.c:7400 btrfs_ioctl_send+0x26e/0x1760 [btrfs]

Additional info:
The warning message is related to deleting the directory in which the snapshot was created. I'll mark this step in the script.
If I don't delete this directory, the warning doesn't appear.
Comment 1 Mikhail Feoktistov 2023-11-06 16:35:25 UTC
Warning message is generated here

../fs/btrfs/send.c

long btrfs_ioctl_send(struct inode *inode, struct btrfs_ioctl_send_args *arg)
....
	WARN_ON(sctx && !ret && !RB_EMPTY_ROOT(&sctx->orphan_dirs));