Skip to contentSkip to conversation

block group 11778977169408 has wrong amount of free space

DISCUSSION Christoph Anton Mitterer 2 participants 4 messages Sep 4, 2017 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hey.

Just got the following:

$ uname -a
Linux heisenberg 4.12.0-1-amd64 #1 SMP Debian 4.12.6-1 (2017-08-12)
x86_64 GNU/Linux
$ btrfs version
btrfs-progs v4.12

on a filesystem:

# btrfs check  /dev/mapper/data-a2 ; echo $?
Checking filesystem on /dev/mapper/data-a2
UUID: f8acb432-7604-46ba-b3ad-0abe8e92c4db
checking extents
checking free space cache
block group 11778977169408 has wrong amount of free space
failed to load free space cache for block group 11778977169408
checking fs roots
checking csums
checking root refs
found 4404625739776 bytes used, no error found
total csum bytes: 4293007908
total tree bytes: 7511900160
total fs tree bytes: 1856258048
total extent tree bytes: 1097859072
btree space waste bytes: 887753954
file data blocks allocated: 4397113839616
 referenced 4515055988736
0

Any idea what could cause these free space issues and how to clean them up? Thought that should work with recent kernels.... could that mean some data will be corrupted when I do e.g. mount with clean_cache?

Interestingly, $? is still 0... even though errors were found. And kernel log shows nothing.

Cheers,
Chris.

#1 lore raw

Just checked, and mounting with clear_cache, and then re-fscking doesn't even fix the problem...

Output stays the same.

Cheers,
Chris.

#2 lore raw
In reply to Christoph Anton Mitterer

Did another mount with clear_cache,rw (cause it was ro before)... now I get even more errors:

# btrfs check  /dev/mapper/data-a2 ; echo $?
Checking filesystem on /dev/mapper/data-a2
UUID: f8acb432-7604-46ba-b3ad-0abe8e92c4db
checking extents
checking free space cache
block group 9857516175360 has wrong amount of free space
failed to load free space cache for block group 9857516175360
block group 11778977169408 has wrong amount of free space
failed to load free space cache for block group 11778977169408
checking fs roots
checking csums
checking root refs
found 4404625330176 bytes used, no error found
total csum bytes: 4293007908
total tree bytes: 7511883776
total fs tree bytes: 1856258048
total extent tree bytes: 1097842688
btree space waste bytes: 887738230
file data blocks allocated: 4397113446400
 referenced 4515055595520
0

what the???

#3 lore raw
Quoted 24 lines · Christoph Anton Mitterer

Did another mount with clear_cache,rw (cause it was ro before)... now I get even more errors:

# btrfs check  /dev/mapper/data-a2 ; echo $?
Checking filesystem on /dev/mapper/data-a2
UUID: f8acb432-7604-46ba-b3ad-0abe8e92c4db
checking extents
checking free space cache
block group 9857516175360 has wrong amount of free space
failed to load free space cache for block group 9857516175360
block group 11778977169408 has wrong amount of free space
failed to load free space cache for block group 11778977169408
checking fs roots
checking csums
checking root refs
found 4404625330176 bytes used, no error found
total csum bytes: 4293007908
total tree bytes: 7511883776
total fs tree bytes: 1856258048
total extent tree bytes: 1097842688
btree space waste bytes: 887738230
file data blocks allocated: 4397113446400
  referenced 4515055595520
0
Quoted 2 lines

what the???

IIRC clear_cache will only clear the cache of modified block groups for v1 space cache.

And that's why we have btrfs check --clear-space-cache v1, which will wipe out all (v1) space cache.

Thanks,
Qu