summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorAnand Jain2018-01-22 23:49:37 +0100
committerDavid Sterba2018-03-26 15:09:37 +0200
commitb1b8e38622ea044ccdee0460253e428cb6e9038e (patch)
treefe9299aa1e6a9a628b76208d03271dbb367f190a /fs/btrfs/volumes.c
parentbtrfs: keep device list sorted (diff)
downloadkernel-qcow2-linux-b1b8e38622ea044ccdee0460253e428cb6e9038e.tar.gz
kernel-qcow2-linux-b1b8e38622ea044ccdee0460253e428cb6e9038e.tar.xz
kernel-qcow2-linux-b1b8e38622ea044ccdee0460253e428cb6e9038e.zip
btrfs: insert newly opened device to the end of the list
Add opened device to the tail of dev_alloc_list instead of head, so that it maintains the same order as dev_list. Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index abc6555105bb..b2a2afe980f9 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -709,7 +709,7 @@ static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices,
if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state) &&
device->devid != BTRFS_DEV_REPLACE_DEVID) {
fs_devices->rw_devices++;
- list_add(&device->dev_alloc_list, &fs_devices->alloc_list);
+ list_add_tail(&device->dev_alloc_list, &fs_devices->alloc_list);
}
brelse(bh);