-
Notifications
You must be signed in to change notification settings - Fork 265
Open
Labels
Description
The output of btrfs send gets corrupted, if the system suspends/resumes or the terminal is resized. btrfs send returns 0. The corruption is reported by btrfs receive as “ERROR: crc32 mismatch in command”.
strace shows that the ioctl() used to send the data to user space gets restarted:
ioctl(5, BTRFS_IOC_SEND, {send_fd=7, clone_sources_count=0, clone_sources=NULL, parent_root=0, flags=BTRFS_SEND_FLAG_VERSION}) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
ioctl(5, BTRFS_IOC_SEND, {send_fd=7, clone_sources_count=0, clone_sources=NULL, parent_root=0, flags=BTRFS_SEND_FLAG_VERSION}) = 0
The output file does not get truncated, probably containing the data of the first ioctl() up to the signal and the second ioctl(). The output file susp is corrupted:
-rw-------. 1 root root 9006882308 Nov 19 10:17 susp
-rw-------. 1 root root 7878804653 Nov 19 10:16 nosusp