]> git.baikalelectronics.ru Git - kernel.git/commitdiff
bcache: set pdev_set_uuid before scond loop iteration
authorYi Li <yili@winhong.com>
Mon, 4 Jan 2021 07:41:18 +0000 (15:41 +0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 9 Jan 2021 16:21:03 +0000 (09:21 -0700)
There is no need to reassign pdev_set_uuid in the second loop iteration,
so move it to the place before second loop.

Signed-off-by: Yi Li <yili@winhong.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/super.c

index a4752ac410dc4e93ed3095a37e1cd9e4a3958977..6aa23a6fb394de6d786531e161fb14bd2b68da71 100644 (file)
@@ -2644,8 +2644,8 @@ static ssize_t bch_pending_bdevs_cleanup(struct kobject *k,
        }
 
        list_for_each_entry_safe(pdev, tpdev, &pending_devs, list) {
+               char *pdev_set_uuid = pdev->dc->sb.set_uuid;
                list_for_each_entry_safe(c, tc, &bch_cache_sets, list) {
-                       char *pdev_set_uuid = pdev->dc->sb.set_uuid;
                        char *set_uuid = c->set_uuid;
 
                        if (!memcmp(pdev_set_uuid, set_uuid, 16)) {