summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/basic/afr/heal-info.t10
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-data.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/basic/afr/heal-info.t b/tests/basic/afr/heal-info.t
index b4da50b3ae9..46d65007c88 100644
--- a/tests/basic/afr/heal-info.t
+++ b/tests/basic/afr/heal-info.t
@@ -8,14 +8,14 @@
cleanup;
function heal_info_to_file {
- while [ -f $M0/a.txt ]; do
+ while [ -f $M0/b.txt ]; do
$CLI volume heal $V0 info | grep -i number | grep -v 0 >> $1
done
}
function write_and_del_file {
dd of=$M0/a.txt if=/dev/zero bs=1024k count=100
- rm -f $M0/a.txt
+ rm -f $M0/b.txt
}
TEST glusterd
@@ -24,13 +24,13 @@ TEST $CLI volume create $V0 replica 2 $H0:$B0/brick{0,1}
TEST $CLI volume set $V0 locking-scheme granular
TEST $CLI volume start $V0
TEST $GFS --volfile-id=$V0 --volfile-server=$H0 $M0;
-TEST touch $M0/a.txt
+TEST touch $M0/a.txt $M0/b.txt
write_and_del_file &
touch $B0/f1 $B0/f2
heal_info_to_file $B0/f1 &
heal_info_to_file $B0/f2 &
wait
-EXPECT "^0$" echo $(wc -l $B0/f1 | awk '{print $1}')
-EXPECT "^0$" echo $(wc -l $B0/f2 | awk '{print $1}')
+EXPECT "^$" cat $B0/f1
+EXPECT "^$" cat $B0/f2
cleanup;
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c
index b55cddc334c..e48fd19110b 100644
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
@@ -809,7 +809,6 @@ afr_selfheal_data_open (xlator_t *this, inode_t *inode, fd_t **fd)
ret = syncop_open (this, &loc, O_RDWR|O_LARGEFILE, fd_tmp, NULL, NULL);
if (ret < 0) {
fd_unref (fd_tmp);
- loc_wipe (&loc);
goto out;
} else {
fd_bind (fd_tmp);
@@ -817,6 +816,7 @@ afr_selfheal_data_open (xlator_t *this, inode_t *inode, fd_t **fd)
*fd = fd_tmp;
out:
+ loc_wipe (&loc);
return ret;
}