Crash at creation of bcache if caching size > backing size
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bcache-tools (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
linux (Ubuntu) |
Expired
|
High
|
Unassigned |
Bug Description
Hi,
I found a bug that crashes the machine if you create a bcache where the caching device size is bigger than backing device.
This case may happen if you create a bcache with a plan to add a bigger disk/partition/raid later to it.
To reproduce it follow this steps:
start a vm with utopic-
apt-get update && apt-get install bcache-tools
/dev/sda is 16G caching device
/dev/sdb is 8G backing device
make-bcache --writeback --discard -C /dev/sda -B /dev/sdb
now the machine is hanged!
if you reboot and reinstall bcache-tools
the bcache device has been created
*****
bcache-super-show -f /dev/sda:
=====
sb.magic ok
sb.first_sector 8 [match]
sb.csum 45C96B38A79275A7 [match]
sb.version 0 [cache device]
dev.label (empty)
dev.uuid 155ab65e-
dev.sectors_
dev.sectors_
dev.cache.
dev.cache.
dev.cache.
dev.cache.ordered no
dev.cache.discard yes
dev.cache.pos 0
dev.cache.
cset.uuid bcaa2595-
*****
bcache-super-show /dev/sdb:
=====
sb.magic ok
sb.first_sector 8 [match]
sb.csum F37A1BB08A7F5DE7 [match]
sb.version 1 [backing device]
dev.label (empty)
dev.uuid 341f1c83-
dev.sectors_
dev.sectors_
dev.data.
dev.data.
dev.data.
cset.uuid bcaa2595-
*****
you can format it:
mkfs.ext4 /dev/bcache0
Rejet des blocs de périphérique : complété
Creating filesystem with 2097150 4k blocks and 524288 inodes
Filesystem UUID: b99a09de-
Superblocs de secours stockés sur les blocs :
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocation des tables de groupe : complété
Écriture des tables d'i-noeuds : complété
Création du journal (32768 blocs) : complété
Écriture des superblocs et de l'information de comptabilité du système de
fichiers :
restarting the format gave me an other bug (X.org crashing):
free from cli:
total used free shared buffers cached
Mem: 1017168 814040 203128 195568 91264 513064
-/+ buffers/cache: 209712 807456
Swap: 0 0 0
tail /var/log/syslog:
[ 568.016481] [ 4983] 0 4983 3332 121 11 0 0 mdadm
[ 568.016483] [ 5259] 0 5259 6703 300 19 0 0 mkfs.ext4
[ 568.016484] Out of memory: Kill process 1947 (Xorg) score 38 or sacrifice child
[ 568.016485] Killed process 1947 (Xorg) total-vm:313160kB, anon-rss:35976kB, file-rss:4232kB
[ 568.707107] systemd-
[ 568.707113] systemd-
[ 568.709876] systemd-
[ 568.709890] systemd-
You can unregister the bcache device,but to re-use all disks, you'll need a reboot (cf bug 1377142):
[ 830.811150] bcache: cached_
[ 830.949898] bcache: cache_set_free() Cache set bcaa2595-
This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:
apport-collect 1377130
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.