kdave / btrfs-progs

Development of userspace BTRFS tools
GNU General Public License v2.0
561 stars 244 forks source link

btrfs-progs-v5.11: test convert-tests/019-ext4-copy-timestamps fails #353

Closed pierre-labastie closed 3 years ago

pierre-labastie commented 3 years ago

Kernel: linux 5.11.3 btrfs-progs version: git devel 26ddd8d9001861c22 relevant part of config.log:

configure:6855: checking for EXT4_EPOCH_MASK defined in ext2fs/ext2_fs.h
configure:6878: gcc -c -g -O1 -Wall -D_FORTIFY_SOURCE=2  conftest.c >&5
conftest.c: In function 'main':
conftest.c:50:7: warning: unused variable 'ok' [-Wunused-variable]
   50 |   int ok;
      |       ^~
configure:6878: $? = 0
configure:6886: result: yes

Note that config.h does not contain any reference to HAVE_OWN_EXT4_EPOCH_MASK_DEFINE

Content of convert-tests-results.txt:

=== START TEST 019-ext4-copy-timestamps
$TEST_DEV not given, using /home/pierre/downloads/btrfs-progs/tests/test.img as fallback
====== RUN CHECK truncate -s 0 /home/pierre/downloads/btrfs-progs/tests/test.img
====== RUN CHECK truncate -s 2147483648 /home/pierre/downloads/btrfs-progs/tests/test.img
====== RUN CHECK mke2fs -t ext4 -b 4096 -F /home/pierre/downloads/btrfs-progs/tests/test.img
mke2fs 1.46.1 (9-Feb-2021)
Discarding device blocks: done                            
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: 769fdf54-5963-4559-a5d9-64e46e7fc6d7
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

====== RUN CHECK mount -o loop -t ext4 /home/pierre/downloads/btrfs-progs/tests/test.img /home/pierre/downloads/btrfs-progs/tests/mnt
====== RUN CHECK dd if=/dev/zero bs=1M count=64 of=/home/pierre/downloads/btrfs-progs/tests/mnt/convert_space_holder status=noxfer
64+0 records in
64+0 records out
====== RUN CHECK touch /home/pierre/downloads/btrfs-progs/tests/mnt/file
====== RUN CHECK stat /home/pierre/downloads/btrfs-progs/tests/mnt/file
  File: /home/pierre/downloads/btrfs-progs/tests/mnt/file
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 700h/1792d      Inode: 13          Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2021-03-10 12:27:34.087530618 +0100
Modify: 2021-03-10 12:27:34.087530618 +0100
Change: 2021-03-10 12:27:34.087530618 +0100
 Birth: 2021-03-10 12:27:34.087530618 +0100
====== RUN CHECK stat --format=%x /home/pierre/downloads/btrfs-progs/tests/mnt/file
2021-03-10 12:27:34.087530618 +0100
====== RUN CHECK stat --format=%y /home/pierre/downloads/btrfs-progs/tests/mnt/file
2021-03-10 12:27:34.087530618 +0100
====== RUN CHECK stat --format=%z /home/pierre/downloads/btrfs-progs/tests/mnt/file
2021-03-10 12:27:34.087530618 +0100
====== RUN CHECK umount /home/pierre/downloads/btrfs-progs/tests/test.img
====== RUN CHECK /home/pierre/downloads/btrfs-progs/btrfs-convert /home/pierre/d
ownloads/btrfs-progs/tests/test.img
WARNING: create btrfs filesystem:
        blocksize: 4096
        nodesize:  16384
        features:  extref, skinny-metadata (default)
        checksum:  crc32c
free space report:
        total:     2147483648
        free:      1835794432 (85.49%)
creating ext2 image file
creating btrfs metadata
copy inodes [o] [         0/        13]^Mextended inode (size 256) found but e2fsprogs don't support reading extra timespec

conversion complete
====== RUN CHECK /home/pierre/downloads/btrfs-progs/btrfs check /home/pierre/dow
nloads/btrfs-progs/tests/test.img
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space cache
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups skipped (not enabled on this FS)
Opening filesystem to check...
Checking filesystem on /home/pierre/downloads/btrfs-progs/tests/test.img
UUID: 9b997d61-3afc-4dd6-a877-f5c11b72e36a
found 174587904 bytes used, no error found
total csum bytes: 170160
total tree bytes: 344064
total fs tree bytes: 49152
total extent tree bytes: 16384
btree space waste bytes: 159064
file data blocks allocated: 241352704
 referenced 241352704
====== RUN CHECK /home/pierre/downloads/btrfs-progs/btrfs inspect-internal dump-super -Ffa /home/pierre/downloads/btrfs-progs/tests/test.img
[snip available on demand]
====== RUN CHECK mount -t btrfs -o loop /home/pierre/downloads/btrfs-progs/tests/test.img /home/pierre/downloads/btrfs-progs/tests/mnt
====== RUN CHECK stat /home/pierre/downloads/btrfs-progs/tests/mnt/file
  File: /home/pierre/downloads/btrfs-progs/tests/mnt/file
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 19h/25d Inode: 267         Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2021-03-10 12:27:34.000000000 +0100
Modify: 2021-03-10 12:27:34.000000000 +0100
Change: 2021-03-10 12:27:34.000000000 +0100
 Birth: 1970-01-01 01:00:00.000000000 +0100
====== RUN CHECK stat --format=%x /home/pierre/downloads/btrfs-progs/tests/mnt/file
2021-03-10 12:27:34.000000000 +0100
atime on converted inode does not match
test failed for case 019-ext4-copy-timestamps

Reverting commit 405e36d53 allows the test to pass (but should fail on older distros. I cannot test unfortunately)

I suspect commit 405e36d53 is not complete in the configure.ac part: there should be a AC_DEFINE after the AX_CHECK_DEFINE for EXT4_EPOCH_MASK. But also, it seems to me that the test is reverted in AX_CHECK_DEFINE.

Will submit a patch to the mailing list

kdave commented 3 years ago

You're right, the AC_DEFINE is necessary, I did not properly copy that from HAVE_OWN_FIEMAP_EXTENT_SHARED_DEFINE that I used as a template. Strange that I did verify that on the CI images and it passed.

kdave commented 3 years ago

v2 patch applied and the test now does conditional check if ext4 supports the timestamps.