summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/bugs/bug-895235.t21
-rw-r--r--xlators/cluster/afr/src/afr-transaction.c3
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/bugs/bug-895235.t b/tests/bugs/bug-895235.t
new file mode 100644
index 00000000000..a9f176a7681
--- /dev/null
+++ b/tests/bugs/bug-895235.t
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+
+cleanup;
+TEST glusterd
+TEST pidof glusterd
+
+TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1}
+TEST $CLI volume set $V0 performance.write-behind off
+TEST $CLI volume set $V0 cluster.eager-lock off
+TEST $CLI volume start $V0
+TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id=$V0 $M0 --direct-io-mode=enable
+
+T=$(date +%s)
+TEST dd of=$M0/a if=/dev/zero bs=1M count=1 oflag=append
+T1=$(date +%s)
+EXPECT "0" echo "$(($T1-$T))"
+
+cleanup;
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
index 73dd50f67eb..a1700783709 100644
--- a/xlators/cluster/afr/src/afr-transaction.c
+++ b/xlators/cluster/afr/src/afr-transaction.c
@@ -1275,6 +1275,9 @@ afr_set_delayed_post_op (call_frame_t *frame, xlator_t *this)
if (!priv->post_op_delay_secs)
return;
+ if (!priv->eager_lock)
+ return;
+
local = frame->local;
if (!local)
return;