diff options
author | Coly Li <colyli@suse.de> | 2018-02-27 12:49:29 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-02-27 12:54:25 -0500 |
commit | 02aa8a8b2b84531fa78b9a486d9b2a0700f7bc08 (patch) | |
tree | c624848f67f66824358d4bbbd41f9e32b60673ab /drivers | |
parent | 9c72258870a95671aa301e21ea6639d1d3ec4111 (diff) |
bcache: correct flash only vols (check all uuids)
Commit 2831231d4c3f ("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: 2831231d4c3f ("bcache: reduce cache_set devices iteration by devices_max_used")
Reported-by: Tang Junhui <tang.junhui@zte.com.cn>
Signed-off-by: Coly Li <colyli@suse.de>
Reviewed-by: Michael Lyle <mlyle@lyle.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/bcache/super.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 312895788036..4d1d8dfb2d2a 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c | |||
@@ -1274,7 +1274,7 @@ static int flash_devs_run(struct cache_set *c) | |||
1274 | struct uuid_entry *u; | 1274 | struct uuid_entry *u; |
1275 | 1275 | ||
1276 | for (u = c->uuids; | 1276 | for (u = c->uuids; |
1277 | u < c->uuids + c->devices_max_used && !ret; | 1277 | u < c->uuids + c->nr_uuids && !ret; |
1278 | u++) | 1278 | u++) |
1279 | if (UUID_FLASH_ONLY(u)) | 1279 | if (UUID_FLASH_ONLY(u)) |
1280 | ret = flash_dev_run(c, u); | 1280 | ret = flash_dev_run(c, u); |