blob: 64132a2c6b2071babbb07befb47fb7d75343a948 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#!/bin/bash
#Test that lock fop is not leaking any memory for overlapping regions
. $(dirname $0)/../../include.rc
. $(dirname $0)/../../volume.rc
. $(dirname $0)/../../fileio.rc
cleanup;
LOCK_TEST=$(dirname $0)/issue-2337-lock-mem-leak
build_tester $(dirname $0)/issue-2337-lock-mem-leak.c -o ${LOCK_TEST}
TEST glusterd
TEST pidof glusterd
TEST $CLI volume create $V0 $H0:$B0/${V0}1
#Guard against flush-behind
TEST $CLI volume set $V0 performance.write-behind off
TEST $CLI volume start $V0
TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0
TEST touch $M0/a
TEST fd1=`fd_available`
TEST fd_open $fd1 'w' $M0/a
TEST flock -x $fd1
statedump=$(generate_mount_statedump $V0 $M0)
EXPECT_NOT "^nostatedump$" echo $statedump
#Making sure no one changes this mem-tracker name
TEST grep gf_client_mt_clnt_lock_t $statedump
TEST fd_close $fd1
statedump=$(generate_mount_statedump $V0 $M0)
EXPECT_NOT "^nostatedump$" echo $statedump
TEST ! grep gf_client_mt_clnt_lock_t $statedump
TEST ${LOCK_TEST} $M0/a
statedump=$(generate_mount_statedump $V0 $M0)
EXPECT_NOT "^nostatedump$" echo $statedump
TEST ! grep gf_client_mt_clnt_lock_t $statedump
TEST cleanup_mount_statedump $V0
TEST rm ${LOCK_TEST}
cleanup
|