From: Amir Goldstein Date: Wed, 5 Jul 2017 12:02:03 +0000 (+0300) Subject: overlay/018: test lower hardlinks re-unite on copy up X-Git-Tag: v2022.05.01~1978 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=004a78036ece314feb139d1fe552a043d566e15b;p=xfstests-dev.git overlay/018: test lower hardlinks re-unite on copy up Test that when two lower hardlinks are copied up, they end up as two upper hardlinks of the same upper inode. Drop caches before copy up so there is no knowledge of the copied up hardlink in inode/dcache. 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 46097a93..41855dc3 100755 --- a/tests/overlay/018 +++ b/tests/overlay/018 @@ -111,5 +111,15 @@ echo "== After mount cycle ==" cat $FILES check_ino_nlink $tmp.after_one $tmp.after_cycle +# Drop caches to get the copied up hardlink out of cache +echo 3 > /proc/sys/vm/drop_caches + +# Modify content of the other hardlink +echo "two" >> $foo + +echo "== After write two ==" +cat $FILES +check_ino_nlink $tmp.after_one $tmp.after_two + status=0 exit diff --git a/tests/overlay/018.out b/tests/overlay/018.out index 5b74ee18..adc7f725 100644 --- a/tests/overlay/018.out +++ b/tests/overlay/018.out @@ -12,3 +12,10 @@ zero one zero one +== After write two == +zero +one +two +zero +one +two