Open icebluey opened 3 years ago
assertion failed: 0, in fs/btrfs/dev-replace.c:499
Matching code from 5.10.31:
491 down_write(&dev_replace->rwsem);
492 switch (dev_replace->replace_state) {
493 case BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED:
494 case BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED:
495 case BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED:
496 break;
497 case BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED:
498 case BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED:
499 ASSERT(0);
500 ret = BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED;
501 up_write(&dev_replace->rwsem);
502 goto leave;
503 }
Introduced by commit https://git.kernel.org/linus/5c06147128fbb and it says the assertion is impossible to hit. From the reproducer it seems that when replace fails to start due to ENOSPC it's in a state that the replace state machine does not expect or at least the assertion is based on a wrong assumption.
btrfs-progs: v5.11.1 linux kernel: 5.10.31
After segmentation fault, 'systemctl --force --force reboot' can't even reboot system.
Here's what I did:
In /var/log/messages: