Skip to contentSkip to conversation

254: disable space cache

PATCH In review Li Zefan 3 participants 4 messages Nov 18, 2011 – Nov 21, 2011 Btrfs file system

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 1/1 254: disable space cache

I can't pass 254, and below is the output:

254 3s ... - output mismatch (see 254.out.bad)
...
ID 256 top level 5 path snap
-ID 257 top level 5 path subvol
+ID 258 top level 5 path subvol

When space cache is enabled (and now mkfs.btrfs always enables it), there will be some space cache inodes in the root tree, and they consume some IDs, and that's why "subvol" has the ID 258 but not 257.

Just disable space cache for this test case.

---
 254 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
254 +1 -1
index 5216120..1cd4832 100755
@@ -48,7 +48,7 @@ _supported_os Linux
 _require_scratch
 
 _scratch_mkfs > /dev/null 2>&1
-_scratch_mount
+_scratch_mount -o nospace_cache
 
 # First test basic snapshotting
 echo "Creating file foo in root dir"
Signature · 6 lines
1.7.3.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw
Quoted 24 lines · Li Zefan

I can't pass 254, and below is the output:

254 3s ... - output mismatch (see 254.out.bad)
...
ID 256 top level 5 path snap

(quoted diff) +1 -1
-ID 257 top level 5 path subvol
+ID 258 top level 5 path subvol

When space cache is enabled (and now mkfs.btrfs always enables it), there will be some space cache inodes in the root tree, and they consume some IDs, and that's why "subvol" has the ID 258 but not 257.

Just disable space cache for this test case.

---
 254 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
254 +0 -0
index 5216120..1cd4832 100755

254 _supported_os Linux · line 54

Quoted 8 lines
254 +1 -1
@@ -48,7 +48,7 @@ _supported_os Linux
 _require_scratch
 
 _scratch_mkfs > /dev/null 2>&1
-_scratch_mount
+_scratch_mount -o nospace_cache
 
 # First test basic snapshotting
 echo "Creating file foo in root dir"

I got following error on fedora 16 with your patch:

@@ -1,40 +1,36 @@
QA output created by 254
+mount: wrong fs type, bad option, bad superblock on /dev/sdc2,

+       missing codepage or helper program, or other error
+       In some cases useful info is found in syslog - try
+       dmesg | tail  or so

+
Creating file foo in root dir
List root dir
foo
Creating snapshot of root dir
-Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap' +ERROR: '/mnt2' is not a subvolume
List root dir after snapshot
foo
-snap
List snapshot dir
-foo
+ls: cannot access /mnt2/snap: No such file or directory
:
:

And in dmesg:

[246554.739092] btrfs: unrecognized mount option 'nospace_cache'

Thanks,
H.Seto

author
#2 lore raw
Quoted 27 lines · Hidetoshi Seto
Quoted 26 lines · Li Zefan

I can't pass 254, and below is the output:

254 3s ... - output mismatch (see 254.out.bad)
...
ID 256 top level 5 path snap

(quoted diff) +1 -1
-ID 257 top level 5 path subvol
+ID 258 top level 5 path subvol

When space cache is enabled (and now mkfs.btrfs always enables it), there will be some space cache inodes in the root tree, and they consume some IDs, and that's why "subvol" has the ID 258 but not 257.

Just disable space cache for this test case.

---
 254 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
254 +0 -0
index 5216120..1cd4832 100755
@@ -48,7 +48,7 @@ _supported_os Linux
 _require_scratch
 
Quoted 9 lines

254 _supported_os Linux · line 54

Quoted 6 lines
254 +1 -1
 _scratch_mkfs > /dev/null 2>&1
-_scratch_mount
+_scratch_mount -o nospace_cache
 
 # First test basic snapshotting
 echo "Creating file foo in root dir"

I got following error on fedora 16 with your patch:

This is an alternative fix:

========================

[PATCH] 254: avoid output mismatch due to space cache

I can't pass 254, and below is the output:

254 3s ... - output mismatch (see 254.out.bad)
...
ID 256 top level 5 path snap
-ID 257 top level 5 path subvol
+ID 258 top level 5 path subvol

When space cache is enabled (and now mkfs.btrfs always enables it), there will be some space cache inodes in the root tree, and they consume some IDs, and that's why "subvol" has the ID 258 but not 257.

Just list subvolume names, don't assume what ID numbers those subvolumes will have.

---
 254     |    2 +-
 254.out |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
254 +1 -1
index 5216120..7b74a02 100755
@@ -95,7 +95,7 @@ ls $SCRATCH_MNT
 
 # Test listing the subvolumes
 echo "Listing subvolumes"
-btrfs subvolume list $SCRATCH_MNT | _filter_scratch
+btrfs subvolume list $SCRATCH_MNT | awk '{ print $NF }'
 
 # Delete the snapshot
 btrfs subvolume delete $SCRATCH_MNT/snap | _filter_scratch
254.out +2 -2
index 582357a..d4b5346 100644
@@ -31,8 +31,8 @@ List root dir
 snap
 subvol
 Listing subvolumes
-ID 256 top level 5 path snap
-ID 257 top level 5 path subvol
+snap
+subvol
 Delete subvolume 'SCRATCH_MNT/snap'
 List root dir
 subvol
Signature · 6 lines
1.7.3.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#3 lore raw
Quoted 1 line · Li Zefan

This is an alternative fix:

I have already applied your previous one. Can you rediff it ontop of the current xfstests-dev tree?