linux/drivers/md/bcache
Michael Lyle 86755b7a96 bcache: don't attach backing with duplicate UUID
This can happen e.g. during disk cloning.

This is an incomplete fix: it does not catch duplicate UUIDs earlier
when things are still unattached.  It does not unregister the device.
Further changes to cope better with this are planned but conflict with
Coly's ongoing improvements to handling device errors.  In the meantime,
one can manually stop the device after this has happened.

Attempts to attach a duplicate device result in:

[  136.372404] loop: module loaded
[  136.424461] bcache: register_bdev() registered backing device loop0
[  136.424464] bcache: bch_cached_dev_attach() Tried to attach loop0 but duplicate UUID already attached

My test procedure is:

  dd if=/dev/sdb1 of=imgfile bs=1024 count=262144
  losetup -f imgfile

Signed-off-by: Michael Lyle <mlyle@lyle.org>
Reviewed-by: Tang Junhui <tang.junhui@zte.com.cn>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2018-03-05 14:43:07 -07:00
..
alloc.c bcache: properly set task state in bch_writeback_thread() 2018-02-07 12:50:01 -07:00
bcache.h bcache: fix for data collapse after re-attaching an attached device 2018-02-07 12:50:01 -07:00
bset.c
bset.h
btree.c bcache: fix for allocator and register thread race 2018-02-07 12:50:01 -07:00
btree.h
closure.c
closure.h
debug.c
debug.h
extents.c
extents.h
io.c
journal.c bcache: fix high CPU occupancy during journal 2018-02-07 12:50:01 -07:00
journal.h
Kconfig
Makefile
movinggc.c
request.c bcache: fix kcrashes with fio in RAID5 backend dev 2018-02-27 10:54:28 -07:00
request.h
stats.c
stats.h
super.c bcache: don't attach backing with duplicate UUID 2018-03-05 14:43:07 -07:00
sysfs.c bcache: fix for data collapse after re-attaching an attached device 2018-02-07 12:50:01 -07:00
sysfs.h
trace.c
util.c
util.h bcache: fix high CPU occupancy during journal 2018-02-07 12:50:01 -07:00
writeback.c bcache: set writeback_rate_update_seconds in range [1, 60] seconds 2018-02-07 12:50:01 -07:00
writeback.h bcache: set writeback_rate_update_seconds in range [1, 60] seconds 2018-02-07 12:50:01 -07:00