summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/basic/ctime/ctime-heal-symlinks.t69
-rw-r--r--xlators/features/utime/src/utime-gen-fops-c.py2
-rw-r--r--xlators/features/utime/src/utime-gen-fops-h.py2
-rw-r--r--xlators/features/utime/src/utime-helpers.c1
-rw-r--r--xlators/features/utime/src/utime.c1
-rw-r--r--xlators/storage/posix/src/posix-inode-fd-ops.c2
6 files changed, 71 insertions, 6 deletions
diff --git a/tests/basic/ctime/ctime-heal-symlinks.t b/tests/basic/ctime/ctime-heal-symlinks.t
new file mode 100644
index 00000000000..3922b12546d
--- /dev/null
+++ b/tests/basic/ctime/ctime-heal-symlinks.t
@@ -0,0 +1,69 @@
+#!/bin/bash
+. $(dirname $0)/../../include.rc
+. $(dirname $0)/../../volume.rc
+. $(dirname $0)/../../afr.rc
+cleanup;
+
+###############################################################################
+TEST glusterd
+TEST pidof glusterd
+TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0,1,2}
+TEST $CLI volume set $V0 performance.stat-prefetch off
+TEST $CLI volume set $V0 ctime on
+TEST $CLI volume set $V0 utime on
+TEST $CLI volume start $V0
+
+TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 --entry-timeout=0 $M0;
+
+cd $M0
+TEST "echo hello_world > FILE"
+TEST ln -s FILE SOFTLINK
+
+# Remove symlink only (not the .glusterfs entry) and trigger named heal.
+TEST rm -f $B0/${V0}2/SOFTLINK
+TEST stat SOFTLINK
+
+# To heal and clear new-entry mark on source bricks.
+TEST $CLI volume heal $V0
+EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count $V0
+
+EXPECT 2 stat -c %h $B0/${V0}2/SOFTLINK
+EXPECT "hello_world" cat $B0/${V0}2/SOFTLINK
+
+cd -
+cleanup
+###############################################################################
+
+TEST glusterd
+TEST pidof glusterd
+TEST $CLI volume create $V0 disperse 3 redundancy 1 $H0:$B0/${V0}{0,1,2}
+TEST $CLI volume set $V0 performance.stat-prefetch off
+TEST $CLI volume set $V0 ctime on
+TEST $CLI volume set $V0 utime on
+TEST $CLI volume start $V0
+
+TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 --entry-timeout=0 $M0;
+
+cd $M0
+TEST "echo hello_world > FILE"
+TEST ln -s FILE SOFTLINK
+
+# Remove symlink only (not the .glusterfs entry) and trigger named heal.
+TEST rm -f $B0/${V0}2/SOFTLINK
+TEST stat SOFTLINK
+
+# To heal and clear new-entry mark on source bricks.
+TEST $CLI volume heal $V0
+EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count $V0
+
+EXPECT 2 stat -c %h $B0/${V0}2/SOFTLINK
+TEST kill_brick $V0 $H0 $B0/${V0}0
+cd -
+EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
+TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 --entry-timeout=0 $M0;
+cd $M0
+EXPECT "hello_world" cat SOFTLINK
+
+cd -
+cleanup
+###############################################################################
diff --git a/xlators/features/utime/src/utime-gen-fops-c.py b/xlators/features/utime/src/utime-gen-fops-c.py
index 4e22c2df0bc..0e40485e6bc 100644
--- a/xlators/features/utime/src/utime-gen-fops-c.py
+++ b/xlators/features/utime/src/utime-gen-fops-c.py
@@ -86,7 +86,7 @@ gf_utime_@NAME@ (call_frame_t *frame, xlator_t *this,
}
"""
-utime_ops = ['fallocate', 'zerofill', 'opendir', 'readlink', 'mknod', 'mkdir',
+utime_ops = ['fallocate', 'zerofill', 'opendir', 'mknod', 'mkdir',
'unlink', 'rmdir', 'symlink', 'rename', 'link', 'truncate',
'ftruncate', 'create', 'open', 'removexattr', 'fremovexattr']
diff --git a/xlators/features/utime/src/utime-gen-fops-h.py b/xlators/features/utime/src/utime-gen-fops-h.py
index 9f0270d5ae8..88086bef32d 100644
--- a/xlators/features/utime/src/utime-gen-fops-h.py
+++ b/xlators/features/utime/src/utime-gen-fops-h.py
@@ -14,7 +14,7 @@ gf_utime_@NAME@ (call_frame_t *frame, xlator_t *this,
@LONG_ARGS@);
"""
-utime_ops = ['fallocate', 'zerofill', 'opendir', 'readlink', 'mknod', 'mkdir',
+utime_ops = ['fallocate', 'zerofill', 'opendir', 'mknod', 'mkdir',
'unlink', 'rmdir', 'symlink', 'rename', 'link', 'truncate',
'ftruncate', 'create', 'open', 'removexattr', 'fremovexattr',
'readv', 'writev', 'setattr', 'fsetattr']
diff --git a/xlators/features/utime/src/utime-helpers.c b/xlators/features/utime/src/utime-helpers.c
index 8dcd2647a35..6cac9651190 100644
--- a/xlators/features/utime/src/utime-helpers.c
+++ b/xlators/features/utime/src/utime-helpers.c
@@ -41,7 +41,6 @@ utime_update_attribute_flags(call_frame_t *frame, glusterfs_fop_t fop)
break;
case GF_FOP_OPENDIR:
- case GF_FOP_READLINK:
case GF_FOP_OPEN:
case GF_FOP_READ:
frame->root->flags |= MDATA_ATIME;
diff --git a/xlators/features/utime/src/utime.c b/xlators/features/utime/src/utime.c
index 27a0e260ca4..a8d74d9cb5c 100644
--- a/xlators/features/utime/src/utime.c
+++ b/xlators/features/utime/src/utime.c
@@ -202,7 +202,6 @@ struct xlator_fops fops = {
.setattr = gf_utime_setattr,
.fsetattr = gf_utime_fsetattr,
.opendir = gf_utime_opendir,
- .readlink = gf_utime_readlink,
.removexattr = gf_utime_removexattr,
};
struct xlator_cbks cbks = {
diff --git a/xlators/storage/posix/src/posix-inode-fd-ops.c b/xlators/storage/posix/src/posix-inode-fd-ops.c
index 6fe25500312..64c7a3240e9 100644
--- a/xlators/storage/posix/src/posix-inode-fd-ops.c
+++ b/xlators/storage/posix/src/posix-inode-fd-ops.c
@@ -1270,8 +1270,6 @@ posix_readlink (call_frame_t *frame, xlator_t *this,
goto out;
}
- posix_set_ctime (frame, this, real_path, -1, loc->inode, &stbuf);
-
dest[op_ret] = 0;
out:
SET_TO_OLD_FS_ID ();