Skip to content

btrfs send: suspend/resume or resize terminal corrupts output (crc32 mismatch) #1063

@tk-2345

Description

@tk-2345

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

See https://discussion.fedoraproject.org/t/btrfs-receive-error-crc32-mismatch-in-command-how-to-proceed/171459.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugkernelsomething in kernel has to be done too

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions