On Sun, Nov 25, 2012 at 12:17:03AM -0800, Jonathan Nieder wrote: > Unfortunately 99f5944b8477 fixes a regression introduced in > v3.5-rc3~1^2~14 (Btrfs: use rcu to protect device->name, 2012-06-04), > so it can't be the fix on its own. How did you track down that patch? > E.g., did you bisect?
No I was lazy, I just asked on btrfs mailing list: http://thread.gmane.org/gmane.comp.file-systems.btrfs/19716 The answer and the patch looked reasonable and as it was working with 3.6.0-rc5, I was happy. I could try to apply this patch to the current Debian kernel to see if it solves the issue. Do you think this bug should be considered as RC as it prevents people to change disk in btrfs-raid configuration? Here is the patch: commit 99f5944b8477914406173b47b4f261356286730b Author: Josef Bacik <jba...@fusionio.com> Date: Thu Aug 2 10:23:59 2012 -0400 Btrfs: do not strdup non existent strings When we close devices we add back empty devices for some reason that escapes me. In the case of a missing dev we don't allocate an rcu_string for it's name, so check to see if the device has a name and if it doesn't don't bother strdup()'ing it. Thanks, Signed-off-by: Josef Bacik <jba...@fusionio.com> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index b8708f9..3b39450 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -569,9 +569,11 @@ static int __btrfs_close_devices(struct btrfs_fs_devices *fs_devices) memcpy(new_device, device, sizeof(*new_device)); /* Safe because we are under uuid_mutex */ - name = rcu_string_strdup(device->name->str, GFP_NOFS); - BUG_ON(device->name && !name); /* -ENOMEM */ - rcu_assign_pointer(new_device->name, name); + if (device->name) { + name = rcu_string_strdup(device->name->str, GFP_NOFS); + BUG_ON(device->name && !name); /* -ENOMEM */ + rcu_assign_pointer(new_device->name, name); + } new_device->bdev = NULL; new_device->writeable = 0; new_device->in_fs_metadata = 0; Antoine
signature.asc
Description: Digital signature