From f88cd26064d7aa306720d4e4d48af9086d97fb13 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sun, 15 Nov 2009 21:27:19 +0000 Subject: segfault fix in posix fd_ctx_get() was getting passed with wrong argument (type punned), and hence was getting segfaulted on 32bit systems. 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 f2451a414..fbb2dad74 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -3088,6 +3088,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; @@ -3102,7 +3103,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", @@ -3111,6 +3112,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