linux/drivers/md/bcache
Michael Lyle 30def1e8ff bcache: don't attach backing with duplicate UUID
commit 86755b7a96 upstream.

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>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-06-16 22:22:32 +01:00
..
alloc.c bcache: check ca->alloc_thread initialized before wake up it 2018-02-13 18:42:07 +00:00
bcache.h bcache: fix for gc and write-back race 2017-11-26 13:50:34 +00:00
bset.c bcache: Fix another compiler warning on m68k 2014-02-18 08:55:05 -08:00
bset.h bcache: Add bch_keylist_init_single() 2014-03-18 12:22:36 -07:00
btree.c bcache: Add a cond_resched() call to gc 2016-02-02 19:09:08 +00:00
btree.h bcache: Kill unused freelist 2014-03-18 12:23:36 -07:00
closure.c bcache: kill closure locking code 2014-01-08 13:05:08 -08:00
closure.h arch: Mass conversion of smp_mb__*() 2014-04-18 14:20:48 +02:00
debug.c bcache: Convert debug code to btree_keys 2014-01-08 13:05:13 -08:00
debug.h bcache: Convert debug code to btree_keys 2014-01-08 13:05:13 -08:00
extents.c bcache: remove nested function usage 2014-03-18 12:39:28 -07:00
extents.h bcache: Convert debug code to btree_keys 2014-01-08 13:05:13 -08:00
io.c block: Introduce new bio_split() 2013-11-23 22:33:57 -08:00
journal.c bcache: btree locking rework 2014-03-18 12:23:35 -07:00
journal.h bcache: Fix a shutdown bug 2014-02-25 18:42:49 -08:00
Kconfig bcache: Kill dead cgroup code 2014-03-18 12:22:35 -07:00
Makefile bcache: Abstract out stuff needed for sorting 2014-01-08 13:05:12 -08:00
movinggc.c bcache: stop moving_gc marking buckets that can't be moved. 2014-03-18 12:22:34 -07:00
request.c bcache: recover data from backing when data is clean 2018-03-03 15:51:33 +00:00
request.h bcache: Kill dead cgroup code 2014-03-18 12:22:35 -07:00
stats.c bcache: Kill dead cgroup code 2014-03-18 12:22:35 -07:00
stats.h bcache: Break up struct search 2013-11-10 21:56:32 -08:00
super.c bcache: don't attach backing with duplicate UUID 2018-06-16 22:22:32 +01:00
sysfs.c bcache: Correct return value for sysfs attach errors 2017-11-26 13:50:34 +00:00
sysfs.h bcache: Don't export utility code, prefix with bch_ 2013-03-28 12:50:55 -06:00
trace.c bcache: Better alloc tracepoints 2014-03-18 12:22:35 -07:00
util.c bcache: fix bch_hprint crash and improve output 2017-11-26 13:50:35 +00:00
util.h bcache: Convert debug code to btree_keys 2014-01-08 13:05:13 -08:00
writeback.c bcache: initialize dirty stripes in flash_dev_run() 2017-11-26 13:50:35 +00:00
writeback.h bcache: initialize dirty stripes in flash_dev_run() 2017-11-26 13:50:35 +00:00