From baddf332d589d29d9bcb18d11dcbb875650e4298 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 4 Sep 2012 21:10:45 +0530 Subject: storage/posix: Make posix_fremovexattr anon fd friendly. Problem: For anonymous fds posix_fremovexattr fails to work because the open never happens and the fd-ctx is not set with the fd-number. Fix: Use posix_fd_ctx_get which opens and sets the fd-number in the fd-ctx for anonymous fds. Tests: Added a syncop call in glustershd to test this change and it worked fine. Change-Id: I9629190a87eb27a7a1578e4fe732a5eb1248f30c BUG: 854331 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/3903 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Anand Avati --- xlators/storage/posix/src/posix.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'xlators/storage') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index d24e70cbd..6a3f4e76c 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -2984,7 +2984,6 @@ posix_fremovexattr (call_frame_t *frame, xlator_t *this, int32_t op_errno = 0; struct posix_fd * pfd = NULL; int _fd = -1; - uint64_t tmp_pfd = 0; int ret = -1; DECLARE_OLD_FS_ID_VAR; @@ -2995,15 +2994,13 @@ posix_fremovexattr (call_frame_t *frame, xlator_t *this, goto out; } - ret = fd_ctx_get (fd, this, &tmp_pfd); + ret = posix_fd_ctx_get (fd, this, &pfd); if (ret < 0) { op_errno = -ret; gf_log (this->name, GF_LOG_WARNING, "pfd is NULL from fd=%p", fd); goto out; } - pfd = (struct posix_fd *)(long)tmp_pfd; - _fd = pfd->fd; -- cgit