Skip to content

Commit 02aa8a8

Browse files
Coly Liaxboe
authored andcommitted
bcache: correct flash only vols (check all uuids)
Commit 2831231 ("bcache: reduce cache_set devices iteration by devices_max_used") adds c->devices_max_used to reduce iteration of c->uuids elements, this value is updated in bcache_device_attach(). But for flash only volume, when calling flash_devs_run(), the function bcache_device_attach() is not called yet and c->devices_max_used is not updated. The unexpected result is, the flash only volume won't be run by flash_devs_run(). This patch fixes the issue by iterate all c->uuids elements in flash_devs_run(). c->devices_max_used will be updated properly when bcache_device_attach() gets called. [mlyle: commit subject edited for character limit] Fixes: 2831231 ("bcache: reduce cache_set devices iteration by devices_max_used") Reported-by: Tang Junhui <[email protected]> Signed-off-by: Coly Li <[email protected]> Reviewed-by: Michael Lyle <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 9c72258 commit 02aa8a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/bcache/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ static int flash_devs_run(struct cache_set *c)
12741274
struct uuid_entry *u;
12751275

12761276
for (u = c->uuids;
1277-
u < c->uuids + c->devices_max_used && !ret;
1277+
u < c->uuids + c->nr_uuids && !ret;
12781278
u++)
12791279
if (UUID_FLASH_ONLY(u))
12801280
ret = flash_dev_run(c, u);

0 commit comments

Comments
 (0)