mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
btrfs: Init io_lock after cloning btrfs device struct
commit 1cba0cdf5e
upstream.
__btrfs_close_devices() clones btrfs device structs with
memcpy(). Some of the fields in the clone are reinitialized, but it's
missing to init io_lock. In mainline this goes unnoticed, but on RT it
leaves the plist pointing to the original about to be freed lock
struct.
Initialize io_lock after cloning, so no references to the original
struct are left.
Reported-and-tested-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a5646410c2
commit
d0e44ede19
1 changed files with 1 additions and 0 deletions
|
@ -557,6 +557,7 @@ static int __btrfs_close_devices(struct btrfs_fs_devices *fs_devices)
|
|||
new_device->writeable = 0;
|
||||
new_device->in_fs_metadata = 0;
|
||||
new_device->can_discard = 0;
|
||||
spin_lock_init(&new_device->io_lock);
|
||||
list_replace_rcu(&device->dev_list, &new_device->dev_list);
|
||||
|
||||
call_rcu(&device->rcu, free_device);
|
||||
|
|
Loading…
Reference in a new issue