linux/drivers/md/bcache
Coly Li 5342fd4255 bcache: set bcache device into read-only mode for BCH_FEATURE_INCOMPAT_OBSO_LARGE_BUCKET
If BCH_FEATURE_INCOMPAT_OBSO_LARGE_BUCKET is set in incompat feature
set, it means the cache device is created with obsoleted layout with
obso_bucket_site_hi. Now bcache does not support this feature bit, a new
BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE incompat feature bit is added
for a better layout to support large bucket size.

For the legacy compatibility purpose, if a cache device created with
obsoleted BCH_FEATURE_INCOMPAT_OBSO_LARGE_BUCKET feature bit, all bcache
devices attached to this cache set should be set to read-only. Then the
dirty data can be written back to backing device before re-create the
cache device with BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE feature bit
by the latest bcache-tools.

This patch checks BCH_FEATURE_INCOMPAT_OBSO_LARGE_BUCKET feature bit
when running a cache set and attach a bcache device to the cache set. If
this bit is set,
- When run a cache set, print an error kernel message to indicate all
  following attached bcache device will be read-only.
- When attach a bcache device, print an error kernel message to indicate
  the attached bcache device will be read-only, and ask users to update
  to latest bcache-tools.

Such change is only for cache device whose bucket size >= 32MB, this is
for the zoned SSD and almost nobody uses such large bucket size at this
moment. If you don't explicit set a large bucket size for a zoned SSD,
such change is totally transparent to your bcache device.

Fixes: ffa4703275 ("bcache: add bucket_size_hi into struct cache_sb_disk for large bucket")
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-09 09:21:03 -07:00
..
Kconfig
Makefile
alloc.c bcache: remove embedded struct cache_sb from struct cache_set 2020-10-02 14:25:30 -06:00
bcache.h bcache: remove embedded struct cache_sb from struct cache_set 2020-10-02 14:25:30 -06:00
bset.c
bset.h
btree.c bcache: remove embedded struct cache_sb from struct cache_set 2020-10-02 14:25:30 -06:00
btree.h bcache: remove embedded struct cache_sb from struct cache_set 2020-10-02 14:25:30 -06:00
closure.c
closure.h
debug.c bcache: only use block_bytes() on struct cache 2020-10-02 14:25:30 -06:00
debug.h
extents.c bcache: remove embedded struct cache_sb from struct cache_set 2020-10-02 14:25:30 -06:00
extents.h
features.c bcache: introduce BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE for large bucket 2021-01-09 09:21:03 -07:00
features.h bcache: introduce BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE for large bucket 2021-01-09 09:21:03 -07:00
io.c bcache: remove embedded struct cache_sb from struct cache_set 2020-10-02 14:25:30 -06:00
journal.c bcache: remove embedded struct cache_sb from struct cache_set 2020-10-02 14:25:30 -06:00
journal.h
movinggc.c bcache: remove for_each_cache() 2020-10-02 14:25:29 -06:00
request.c block: switch partition lookup to use struct block_device 2020-12-01 14:53:40 -07:00
request.h
stats.c
stats.h
super.c bcache: set bcache device into read-only mode for BCH_FEATURE_INCOMPAT_OBSO_LARGE_BUCKET 2021-01-09 09:21:03 -07:00
sysfs.c md/bcache: convert comma to semicolon 2020-12-23 09:25:15 -07:00
sysfs.h
trace.c
util.c
util.h
writeback.c bcache: fix race between setting bdev state to none and new write request direct to backing 2020-12-07 13:25:16 -07:00
writeback.h