From: Amir Goldstein Date: Wed, 5 Jul 2017 12:02:02 +0000 (+0300) Subject: overlay/018: test broken hardlinks after mount cycle X-Git-Tag: v2022.05.01~1979 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a48fc5d3e9c134043cba4f17b28c41dfa4f00ec8;p=xfstests-dev.git overlay/018: test broken hardlinks after mount cycle This test checks if overlayfs hardlinks are preserved across copy up. Check if they are preserved also after copy up and mount cycle. Signed-off-by: Amir Goldstein Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/tests/overlay/018 b/tests/overlay/018 index 7570a16f..46097a93 100755 --- a/tests/overlay/018 +++ b/tests/overlay/018 @@ -96,11 +96,20 @@ cat $FILES record_ino_nlink $tmp.before # Modify content of one of the hardlinks -echo "one" >> $foo +# Intentionally modify the last hardlink in $FILES, so after mount cycle +# when reading the first file in $FILES, last file won't be in inode/dcache +echo "one" >> $bar echo "== After write one ==" cat $FILES -check_ino_nlink $tmp.before $tmp.after +check_ino_nlink $tmp.before $tmp.after_one + +# Verify that the hardlinks survive a mount cycle +_scratch_cycle_mount + +echo "== After mount cycle ==" +cat $FILES +check_ino_nlink $tmp.after_one $tmp.after_cycle status=0 exit diff --git a/tests/overlay/018.out b/tests/overlay/018.out index 784e8bcf..5b74ee18 100644 --- a/tests/overlay/018.out +++ b/tests/overlay/018.out @@ -7,3 +7,8 @@ zero one zero one +== After mount cycle == +zero +one +zero +one