Gentoo Archives: gentoo-commits

From: "Tiziano Mueller (dev-zero)" <dev-zero@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-cluster/glusterfs/files: glusterfs-3.4.4-fuse-fix-memory-leak-in-fuse_getxattr.patch
Date: Wed, 25 Jun 2014 09:54:34
Message-Id: 20140625095431.68A302004E@flycatcher.gentoo.org
1 dev-zero 14/06/25 09:54:31
2
3 Added:
4 glusterfs-3.4.4-fuse-fix-memory-leak-in-fuse_getxattr.patch
5 Log:
6 Revision bump to pull in backported bugfix for memory leak in FUSE client.
7
8 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 0x1A5D023975B0583D!)
9
10 Revision Changes Path
11 1.1 sys-cluster/glusterfs/files/glusterfs-3.4.4-fuse-fix-memory-leak-in-fuse_getxattr.patch
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/glusterfs/files/glusterfs-3.4.4-fuse-fix-memory-leak-in-fuse_getxattr.patch?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-cluster/glusterfs/files/glusterfs-3.4.4-fuse-fix-memory-leak-in-fuse_getxattr.patch?rev=1.1&content-type=text/plain
15
16 Index: glusterfs-3.4.4-fuse-fix-memory-leak-in-fuse_getxattr.patch
17 ===================================================================
18 From 0cf6f0727482b5b8816b5e58cb67ef124eae808e Mon Sep 17 00:00:00 2001
19 From: Justin Clift <justin@×××××××.org>
20 Date: Tue, 24 Jun 2014 20:57:02 +0100
21 Subject: [PATCH] fuse: fix memory leak in fuse_getxattr()
22
23 The fuse_getxattr() function was not freeing fuse_state_t resulting in a
24 memory leak. As a result, when continuous writes (run dd command in a loop)
25 were done from a FUSE mount point, the OOM killer killed the client
26 process (glusterfs).
27
28 Manual backport of: http://review.gluster.org/#/c/5392/, provided
29 by Martin Svec <martin.svec@×××××.cz>.
30
31 BUG: 1112844
32 Change-Id: Ic723675c53384d48c79ad1b11b21c1b17fb56866
33 ---
34 xlators/mount/fuse/src/fuse-bridge.c | 27 ++++++++++++++-------------
35 1 file changed, 14 insertions(+), 13 deletions(-)
36
37 diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
38 index e531970..da5937b 100644
39 --- a/xlators/mount/fuse/src/fuse-bridge.c
40 +++ b/xlators/mount/fuse/src/fuse-bridge.c
41 @@ -3207,6 +3207,7 @@ fuse_getxattr (xlator_t *this, fuse_in_header_t *finh, void *msg)
42 fuse_state_t *state = NULL;
43 struct fuse_private *priv = NULL;
44 int rv = 0;
45 + int op_errno = EINVAL;
46 char *newkey = NULL;
47
48 priv = this->private;
49 @@ -3227,26 +3228,23 @@ fuse_getxattr (xlator_t *this, fuse_in_header_t *finh, void *msg)
50 "%"PRIu64": GETXATTR %s/%"PRIu64" (%s):"
51 "refusing positioned getxattr",
52 finh->unique, state->loc.path, finh->nodeid, name);
53 - send_fuse_err (this, finh, EINVAL);
54 - FREE (finh);
55 - return;
56 + op_errno = EINVAL;
57 + goto err;
58 }
59 #endif
60
61 if (!priv->acl) {
62 if ((strcmp (name, "system.posix_acl_access") == 0) ||
63 (strcmp (name, "system.posix_acl_default") == 0)) {
64 - send_fuse_err (this, finh, ENOTSUP);
65 - GF_FREE (finh);
66 - return;
67 + op_errno = ENOTSUP;
68 + goto err;
69 }
70 }
71
72 if (!priv->selinux) {
73 if (strncmp (name, "security.", 9) == 0) {
74 - send_fuse_err (this, finh, ENODATA);
75 - GF_FREE (finh);
76 - return;
77 + op_errno = ENODATA;
78 + goto err;
79 }
80 }
81
82 @@ -3254,16 +3252,19 @@ fuse_getxattr (xlator_t *this, fuse_in_header_t *finh, void *msg)
83
84 rv = fuse_flip_xattr_ns (priv, name, &newkey);
85 if (rv) {
86 - send_fuse_err (this, finh, ENOMEM);
87 - free_fuse_state (state);
88 - goto out;
89 + op_errno = ENOMEM;
90 + goto err;
91 }
92
93 state->size = fgxi->size;
94 state->name = newkey;
95
96 fuse_resolve_and_resume (state, fuse_getxattr_resume);
97 - out:
98 +
99 + return;
100 + err:
101 + send_fuse_err (this, finh, op_errno);
102 + free_fuse_state (state);
103 return;
104 }
105
106 --
107 1.9.2