]> git.hungrycats.org Git - linux/commit
Btrfs: fix unprotected assignment of the target device
authorMiao Xie <miaox@cn.fujitsu.com>
Wed, 3 Sep 2014 13:35:32 +0000 (21:35 +0800)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Wed, 3 Dec 2014 15:16:42 +0000 (10:16 -0500)
commit8e704933ef30e27e449f960e7b20176d6d6c651b
tree2a6819615f42dbe3d42e9fc7e249dcf5cfa9fe1f
parent71d1fcff0c35151da7ea44e071ae5cb7c268aeab
Btrfs: fix unprotected assignment of the target device

We didn't protect the assignment of the target device, it might cause the
problem that the super block update was skipped because we might find wrong
size of the target device during the assignment. Fix it by moving the
assignment sentences into the initialization function of the target device.
And there is another merit that we can check if the target device is suitable
more early.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit 1c43366d3b3f0fa6c6e81aaf3aa18e0550245dad)
fs/btrfs/dev-replace.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h