#
#-----------------------------------------------------------------------
#
-# Copyright (C) 2016 CTERA Networks. All Rights Reserved.
+# Copyright (C) 2016-2017 CTERA Networks. All Rights Reserved.
# Author: Amir Goldstein <amir73il@gmail.com>
#
# This program is free software; you can redistribute it and/or
_supported_fs overlay
_supported_os Linux
_require_scratch
+_require_scratch_feature index
rm -f $seqres.full
diff -u $before $after
}
-_scratch_mount
+# Enable overlay index feature to prevent breaking hardlinks on copy up
+_scratch_mount -o index=on
rm -f $tmp.*
check_ino_nlink $tmp.before $tmp.after_one
# Verify that the hardlinks survive a mount cycle
-_scratch_cycle_mount
+_scratch_cycle_mount index=on
echo "== After mount cycle =="
cat $FILES
_supported_fs overlay
_supported_os Linux
_require_scratch
+_require_scratch_feature index
# Remove all files from previous tests
_scratch_mkfs
ln $lowerdir/zero $lowerdir/one
ln $lowerdir/zero $lowerdir/two
-_scratch_mount
+# Enable overlay index feature to prevent breaking hardlinks on copy up
+_scratch_mount -o index=on
do_cmd()
{
_supported_fs overlay
_supported_os Linux
_require_scratch
+_require_scratch_feature index
report_nlink()
{
rm $SCRATCH_MNT/2
# Verify that orphan index is cleaned when dropping nlink to zero
- ls $OVL_BASE_SCRATCH_MNT/$OVL_WORK/index 2>/dev/null
+ ls $OVL_BASE_SCRATCH_MNT/$OVL_WORK/index
}
# Remove all files from previous tests
# Create lower hardlinks
create_hardlinks
-_scratch_mount
+# Enable overlay index feature to prevent breaking hardlinks on copy up
+_scratch_mount -o index=on
# Test hardlinks with warm dcache
DCACHETEMP=warm
test_hardlinks
_scratch_unmount
_scratch_mkfs
create_hardlinks
-_scratch_mount
+_scratch_mount -o index=on
# Test hardlinks with cold dcache
DCACHETEMP=cold
_supported_fs overlay
_supported_os Linux
_require_scratch
+# Without overlay index feature hardlinks are broken on copy up
+_require_scratch_feature index
# Remove all files from previous tests
_scratch_mkfs
touch $lowerdir/0
ln $lowerdir/0 $lowerdir/1
-_scratch_mount
+# Enable overlay index feature to prevent breaking hardlinks on copy up
+_scratch_mount -o index=on
# Copy up lower hardlink - overlay inode nlink 2 is copied from lower
touch $SCRATCH_MNT/0
rm $SCRATCH_MNT/4
# Verify that orphan index is cleaned on mount
-_scratch_cycle_mount
-ls $OVL_BASE_SCRATCH_MNT/$OVL_WORK/index 2>/dev/null
+_scratch_cycle_mount index=on
+ls $OVL_BASE_SCRATCH_MNT/$OVL_WORK/index
echo "Silence is golden"
status=0