Patchwork [BUG:1499] nfs3: Free vectored write args using FREE not GF_FREE

login
register
Submitter Shehjar Tikoo
Date 2010-09-02 11:40:11
Message ID <1283427611-3380-1-git-send-email-shehjart@gluster.com>
Download mbox | patch
Permalink /patch/4482/
State Accepted
Headers show

Comments

Shehjar Tikoo - 2010-09-02 11:40:11
From: Shehjar Tikoo <shehjart@gluster.com>

..because the file handle in write3args is allocated inside
libc using malloc not memory accounting code in glusterfs.

Signed-off-by: Shehjar Tikoo <shehjart@gluster.com>
---
 xlators/nfs/lib/src/xdr-nfs3.c |    3 +--
 xlators/nfs/server/src/nfs3.c  |    1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/xlators/nfs/lib/src/xdr-nfs3.c b/xlators/nfs/lib/src/xdr-nfs3.c
index 0ea23dc..97ec1b6 100644
--- a/xlators/nfs/lib/src/xdr-nfs3.c
+++ b/xlators/nfs/lib/src/xdr-nfs3.c
@@ -1891,8 +1891,7 @@  xdr_free_write3args_nocopy (write3args *wa)
         if (!wa)
                 return;
 
-        GF_FREE (wa->file.data.data_val);
-        GF_FREE (wa);
+        FREE (wa->file.data.data_val);
 }
 
 
diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c
index 67ad662..057ccb6 100644
--- a/xlators/nfs/server/src/nfs3.c
+++ b/xlators/nfs/server/src/nfs3.c
@@ -1929,6 +1929,7 @@  nfs3svc_write_vec (rpcsvc_request_t *req, struct iobuf *iob)
         ret = nfs3_write (req, (struct nfs3_fh *)args->file.data.data_val,
                           args->offset, args->count, args->stable, payload,iob);
         xdr_free_write3args_nocopy (args);
+        GF_FREE (args);
         if (ret < 0) {
                 gf_log (GF_NFS3, GF_LOG_ERROR, "WRITE procedure failed");
                 nfs_rpcsvc_request_seterr (req, SYSTEM_ERR);