From 63e966d8c466599f84affb55fbedfb39e2a0068f Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sun, 15 Nov 2009 21:39:20 +0000 Subject: fixing a crash in posix (on 32bit) fd_ctx_get () was getting passed with type punned argument, now corrected by passing the right argument, and doing the typecasting later Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 383 (glusterfs server crash on 2.0.8) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=383 --- xlators/storage/posix/src/posix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/storage/posix/src/posix.c') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 5ef577910a5..23db0d72ad7 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -3479,6 +3479,7 @@ do_xattrop (call_frame_t *frame, xlator_t *this, int ret = 0; int _fd = -1; + uint64_t tmp_pfd = 0; struct posix_fd *pfd = NULL; data_pair_t *trav = NULL; @@ -3493,7 +3494,7 @@ do_xattrop (call_frame_t *frame, xlator_t *this, trav = xattr->members_list; if (fd) { - ret = fd_ctx_get (fd, this, (uint64_t *)&pfd); + ret = fd_ctx_get (fd, this, &tmp_pfd); if (ret < 0) { gf_log (this->name, GF_LOG_DEBUG, "failed to get pfd from fd=%p", @@ -3502,6 +3503,7 @@ do_xattrop (call_frame_t *frame, xlator_t *this, op_errno = EBADFD; goto out; } + pfd = (struct posix_fd *)(long)tmp_pfd; _fd = pfd->fd; } -- cgit