linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* btrfs check --clear-space-cache v1 fails if not --clear-space-cache v2 first
@ 2017-09-08 19:51 A L
  0 siblings, 0 replies; only message in thread
From: A L @ 2017-09-08 19:51 UTC (permalink / raw)
  To: linux-btrfs

Seems to be some inconsistency with btrfs check --clear-space-cache v1. 
It only worked after clearing v2 space cache. See below result.

Background. Since some time I was running with space_cache mount option. 
I recently changed to space_cache=v2 and used "clear_cache" mount option 
to clear out the old v1 cache. From reading this mailings list I found 
that I should really use btrfs check --clear-space-cache v1 to truly 
clear the old version space cache.

btrfs-progs-4.13
kernel-4.13

    # btrfs check --clear-space-cache v1 /dev/sdb1
    couldn't open RDWR because of unsupported option features (3).
    ERROR: cannot open file system

    # btrfs check /dev/sdb1
    Checking filesystem on /dev/sdb1
    UUID: e0ea1dc2-948a-488c-ad46-98236939b373
    checking extents
    checking free space tree
    cache and super generation don't match, space cache will be invalidated
    checking fs roots
    checking csums
    checking root refs
    found 305286168601 bytes used, no error found
    total csum bytes: 246501768
    total tree bytes: 415334400
    total fs tree bytes: 87130112
    total extent tree bytes: 45481984
    btree space waste bytes: 65894664
    file data blocks allocated: 5691562237952
      referenced 341901901824

    # btrfs check --clear-space-cache v1 /dev/sdb1
    couldn't open RDWR because of unsupported option features (3).
    ERROR: cannot open file system

    # btrfs check --clear-space-cache v2 /dev/sdb1
    Checking filesystem on /dev/sdb1
    UUID: e0ea1dc2-948a-488c-ad46-98236939b373
    Clear free space cache v2
    free space cache v2 cleared

    # btrfs check --clear-space-cache v2 /dev/sdb1
    Checking filesystem on /dev/sdb1
    UUID: e0ea1dc2-948a-488c-ad46-98236939b373
    no free space cache v2 to clear

    # btrfs check --clear-space-cache v1 /dev/sdb1
    Checking filesystem on /dev/sdb1
    UUID: e0ea1dc2-948a-488c-ad46-98236939b373
    Clearing free space cache
    Free space cache cleared

    # btrfs check /dev/sdb1
    Checking filesystem on /dev/sdb1
    UUID: e0ea1dc2-948a-488c-ad46-98236939b373
    checking extents
    checking free space tree
    checking fs roots
    checking csums
    checking root refs
    found 305220087844 bytes used, no error found
    total csum bytes: 246501768
    total tree bytes: 415236096
    total fs tree bytes: 87130112
    total extent tree bytes: 45481984
    btree space waste bytes: 65905890
    file data blocks allocated: 5691495915520
      referenced 341835579392

Now, why do I not get "no free space cache v1 to clear" when running it 
several times more?

    # btrfs check --clear-space-cache v1 /dev/sdb1
    Checking filesystem on /dev/sdb1
    UUID: e0ea1dc2-948a-488c-ad46-98236939b373
    Clearing free space cache

The exact same happen on my other volumes, both single devices and RAID1.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-08 19:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-08 19:51 btrfs check --clear-space-cache v1 fails if not --clear-space-cache v2 first A L

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).