Skip to contentSkip to conversation

Another metadata corruption issue in dm-cache

DISCUSSION Steinar H. Gunderson 1 participant 2 messages Feb 16, 2014 – Feb 18, 2014 Device mapper

lore
Share & tools
lore
#0 lore raw

Hi,

I recently upgraded to 3.13.2, and the number of dirty blocks suddenly started to plummet (I guess somebody fixed writeback :-) ). However, later I inserted two new disks into my RAID, reshaped it, and then reloaded the cache device (directly on top of the md, below LVM) to increase its size.

This worked fine; however, all blocks were now considered dirty, and a new writeback started (I always get this issue whenever I do load/resume on dm-cache). At the very end, however, the kernel log spit out:

  [233728.653343] device-mapper: space map common: index_check failed: blocknr 34359738543 != wanted 1726
  [233728.662920] device-mapper: block manager: index validator check failed for block 1726
  [233728.674456] device-mapper: space map common: unable to decrement a reference count below 0
  [233728.683282] device-mapper: cache: could not commit metadata for accurate status

nd then the reference count and commit messages several times, and all my filesystems started getting into problems.

Rebooting didn't help; it complained about the same index_check issue, refusing to set up the device.

I didn't take a snapshot of the metadata device (it's not so easy to rescue things out from the initramfs); I zeroed it, since all the filesystems appeared to be in reasonably good shape anyway (not so strange with everything written back), and some fsck rounds later, everything was back into shape.

So, seemingly there are still issues...

/* Steinar */

Signature · 1 line
Homepage: http://www.sesse.net/
#1 lore raw
Quoted 1 line · Steinar H. Gunderson
  [233728.674456] device-mapper: space map common: unable to decrement a reference count below 0

Actually a similar issue to this seems to have manifested itself in 3.13 even after I nuked all the metadata; the dmsetup status line now reads:

cache: 0 35161337856 cache 1728/131072 2772587 12086450 2085299 1111070 0 260440 265439 4294967295 1 writeback 2 migration_threshold 2048 4 random_threshold 8 sequential_threshold 512

Occasionally, the 4294967295 dips up to 0 or 1, and then goes straight back down again. So there seems to be an off-by-one somewhere in the counting of blocks.

/* Steinar */

Signature · 1 line
Homepage: http://www.sesse.net/