overlay/018: test lower hardlinks re-unite on copy up
authorAmir Goldstein <amir73il@gmail.com>
Wed, 5 Jul 2017 12:02:03 +0000 (15:02 +0300)
committerEryu Guan <eguan@redhat.com>
Thu, 6 Jul 2017 05:38:59 +0000 (13:38 +0800)
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 <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/overlay/018
tests/overlay/018.out

index 46097a9342ffc625811c21cf28ec9da308f32b0f..41855dc34f10d21ed5fa7086643ef9146eb830b2 100755 (executable)
@@ -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
index 5b74ee18389f54afd5216fc25d98947083b0dfbd..adc7f725988c0405ed4b35bb69f51f79755a03b7 100644 (file)
@@ -12,3 +12,10 @@ zero
 one
 zero
 one
+== After write two ==
+zero
+one
+two
+zero
+one
+two