]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix regression of btrfs device replace
authorLiu Bo <bo.li.liu@oracle.com>
Tue, 29 Jul 2014 11:09:39 +0000 (19:09 +0800)
committerChris Mason <clm@fb.com>
Thu, 21 Aug 2014 14:55:20 +0000 (07:55 -0700)
commitb365a38d73348fa02c8b5c66fa9ac5ea73cf8344
treeb864ece48f86905381ddf890db911c972fa17e76
parent146c16f6f0f52bf88783c10f77ea5817d97e1472
Btrfs: fix regression of btrfs device replace

Commit 1d47359c01fe39bb31d45217a244c217b59d683d(
btrfs: dev replace should replace the sysfs entry) added the missing sysfs entry
in the process of device replace, but didn't take missing devices into account,
so now we have

BUG: unable to handle kernel NULL pointer dereference at 0000000000000088
IP: [<ffffffffa0268551>] btrfs_kobj_rm_device+0x21/0x40 [btrfs]
...

To reproduce it,
1. mkfs.btrfs -f disk1 disk2
2. mkfs.ext4 disk1
3. mount disk2 /mnt -odegraded
4. btrfs replace start -B 1 disk3 /mnt
--------------------------

This fixes the problem.

Reported-by: Chris Murphy <lists@colorremedies.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Tested-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/sysfs.c