Skip to content

Commit 59a3991

Browse files
asjkdave
authored andcommitted
btrfs: replace: drop assert for suspended replace
If the filesystem mounts with the replace-operation in a suspended state and try to cancel the suspended replace-operation, we hit the assert. The assert came from the commit fe97e2e ("btrfs: dev-replace: replace's scrub must not be running in suspended state") that was actually not required. So just remove it. $ mount /dev/sda5 /btrfs BTRFS info (device sda5): cannot continue dev_replace, tgtdev is missing BTRFS info (device sda5): you may cancel the operation after 'mount -o degraded' $ mount -o degraded /dev/sda5 /btrfs <-- success. $ btrfs replace cancel /btrfs kernel: assertion failed: ret != -ENOTCONN, in fs/btrfs/dev-replace.c:1131 kernel: ------------[ cut here ]------------ kernel: kernel BUG at fs/btrfs/ctree.h:3750! After the patch: $ btrfs replace cancel /btrfs BTRFS info (device sda5): suspended dev_replace from /dev/sda5 (devid 1) to <missing disk> canceled Fixes: fe97e2e ("btrfs: dev-replace: replace's scrub must not be running in suspended state") CC: [email protected] # 5.0+ Signed-off-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 47bf225 commit 59a3991

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/btrfs/dev-replace.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,8 +1129,7 @@ int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info)
11291129
up_write(&dev_replace->rwsem);
11301130

11311131
/* Scrub for replace must not be running in suspended state */
1132-
ret = btrfs_scrub_cancel(fs_info);
1133-
ASSERT(ret != -ENOTCONN);
1132+
btrfs_scrub_cancel(fs_info);
11341133

11351134
trans = btrfs_start_transaction(root, 0);
11361135
if (IS_ERR(trans)) {

0 commit comments

Comments
 (0)