On 2020/9/30 15:54, Amir Goldstein wrote:
On Wed, Sep 30, 2020 at 8:33 AM Xiao Yang<yangx.jy@xxxxxxxxxxxxxx> wrote:
Hi Amir,
I always got diffenent inode number if underlying fileystem is ext4.
------------------------------------------------
# diff -u /var/lib/xfstests/tests/overlay/071.out
/var/lib/xfstests/results//overlay/071.out.bad
--- /var/lib/xfstests/tests/overlay/071.out 2020-09-30
12:59:30.478968816 +0800
+++ /var/lib/xfstests/results//overlay/071.out.bad 2020-09-30
13:13:02.342920819 +0800
@@ -1,2 +1,26 @@
QA output created by 071
+--- /tmp/25096.lower.lo 2020-09-30 13:12:59.594920981 +0800
++++ /tmp/25096.before.lo 2020-09-30 13:12:59.706920975 +0800
+@@ -1,7 +1,7 @@
+-8590721028 file
+-8590721029 symlink
+-8590721030 link
+-8590721031 chrdev
+-8590721032 blkdev
+-8590721033 fifo
+-8590721034 socket
++9223372045445496836 file
++9223372045445496837 symlink
++9223372045445496838 link
++9223372045445496839 chrdev
++9223372045445496840 blkdev
++9223372045445496841 fifo
++9223372045445496842 socket
+file not found by ino 8590721028 (from /tmp/25096.lower.lo) - see
/var/lib/xfstests/results//overlay/071.full
+symlink not found by ino 8590721029 (from /tmp/25096.lower.lo) - see
/var/lib/xfstests/results//overlay/071.full
+link not found by ino 8590721030 (from /tmp/25096.lower.lo) - see
/var/lib/xfstests/results//overlay/071.full
+chrdev not found by ino 8590721031 (from /tmp/25096.lower.lo) - see
/var/lib/xfstests/results//overlay/071.full
+blkdev not found by ino 8590721032 (from /tmp/25096.lower.lo) - see
/var/lib/xfstests/results//overlay/071.full
+fifo not found by ino 8590721033 (from /tmp/25096.lower.lo) - see
/var/lib/xfstests/results//overlay/071.full
+socket not found by ino 8590721034 (from /tmp/25096.lower.lo) - see
/var/lib/xfstests/results//overlay/071.full
Silence is golde
------------------------------------------------
Is this expected behavior? :-)
Yes and No :-)
The result is expected. It is not expected for the test to fail.
This is a test bug.
The bug is in this line and in the comment above it:
# Compare inode numbers in lower overlay vs. nested overlay
# With nested xino lower/lower, all inode numbers overflow xino bits and
# d_ino/i_ino in nested overlay are the same as in lower overlay.
check_inode_numbers $lowertestdir $tmp.lower.lo $tmp.before.lo
This test is meant to cover the case of "xino=on/auto, ino overflow" from:
https://github.com/torvalds/linux/blob/master/Documentation/filesystems/overlayfs.rst#inode-properties
The correct part of the comment is:
# With nested xino lower, all inode numbers overflow xino bits
Meaning that all inode numbers at $lowertestdir have the MSB set
(e.g. file ino 9223372045445496836 = 0x80000002000C0004)
With lower fs xfs, the other part of the comment is also correct:
# ...and d_ino/i_ino in nested overlay are the same as in lower overlay
Because in the lower overlay ($SCRATCH_MNT/lowertestdir)
lower files also have the MSB set.
However, because ext4 has a known inode number limit of 32bit
(see ovl_can_decode_fh) the lower overlay inodes do not have the
MSB set (e.g. file ino 8590721028 = 0x2000C0004).
Long story short, I think we need to remove this line and comment
from the test and leave it the same as overlay/070:
# Record inode numbers before copy up
record_inode_numbers $lowertestdir $tmp.before.lo
record_inode_numbers $uppertestdir $tmp.before.up
This recording is just for the sake of logging info in 070.full.
Hi Amir,
Thanks a lot for your detailed explanation. :-)
I will spend time to read the related code in kernel.
Best Regards,
Xiao Yang
On 2020/9/30 13:04, Xiao Yang wrote:
Replace undefined OVL_BASE_SCRATCH_DIR with OVL_BASE_SCRATCH_MNT
Signed-off-by: Xiao Yang<yangx.jy@xxxxxxxxxxxxxx>
Reviewed-by: Amir Goldstein<amir73il@xxxxxxxxx>
Will you also fix the test bug please.
Sure, I will fix the test bug on a separate patch tomorrow.
Best Regards,
Xiao Yang
Thanks!
Amir.
.