linux-stable/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 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bset.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
btree.c bcache: fix for allocator and register thread race 2018-02-07 12:50:01 -07:00
btree.h Merge branch 'for-4.15/block' of git://git.kernel.dk/linux-block 2017-11-14 15:32:19 -08:00
closure.c bcache: mark closure_sync() __sched 2018-01-08 13:29:00 -07:00
closure.h bcache: closures: move control bits one bit right 2018-01-09 12:18:51 -07:00
debug.c bcache: fix wrong return value in bch_debug_init() 2018-01-08 13:29:00 -07:00
debug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
extents.c bcache: Fix building error on MIPS 2017-11-24 16:22:58 -07:00
extents.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
io.c bcache: fix misleading error message in bch_count_io_errors() 2018-01-08 13:29:00 -07:00
journal.c bcache: fix high CPU occupancy during journal 2018-02-07 12:50:01 -07:00
journal.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig bcache: Kill dead cgroup code 2014-03-18 12:22:35 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
movinggc.c block: move bio_alloc_pages() to bcache 2018-01-06 09:18:00 -07:00
request.c bcache: fix kcrashes with fio in RAID5 backend dev 2018-02-27 10:54:28 -07:00
request.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stats.c md: Convert timers to use timer_setup() 2017-11-14 20:11:57 -07:00
stats.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
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 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
util.c block: move bio_alloc_pages() to bcache 2018-01-06 09:18:00 -07:00
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