From aacde00714c60db438c2fdc5ebacbe60a988f60b Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Sun, 18 Oct 2009 09:58:18 +0000 Subject: storage/posix: Set right the op_ret value from posix_readlink() Since op_ret was being returned as 0, fuse would regard the readlink () as a failure. Also, set right the buffer size of gen_key in posix_{f, l}stat_with_gen. Signed-off-by: Anand V. Avati BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315 --- xlators/storage/posix/src/posix.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'xlators/storage') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index e948a86a110..7c15f92711a 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -226,7 +226,7 @@ posix_lstat_with_gen (xlator_t *this, const char *path, struct stat *stbuf_p) { struct posix_private *priv = NULL; int ret = 0; - char gen_key[256] = {0, }; + char gen_key[1024] = {0, }; uint64_t gen_val_be = 0; uint64_t gen_val = 0; struct stat stbuf = {0, }; @@ -285,7 +285,7 @@ posix_fstat_with_gen (xlator_t *this, int fd, struct stat *stbuf_p) { struct posix_private *priv = NULL; int ret = 0; - char gen_key[256] = {0, }; + char gen_key[1024] = {0, }; uint64_t gen_val_be = 0; uint64_t gen_val = 0; struct stat stbuf = {0, }; @@ -1133,6 +1133,7 @@ posix_readlink (call_frame_t *frame, xlator_t *this, { char * dest = NULL; int32_t op_ret = -1; + int32_t lstat_ret = -1; int32_t op_errno = 0; char * real_path = NULL; struct stat stbuf = {0,}; @@ -1158,8 +1159,9 @@ posix_readlink (call_frame_t *frame, xlator_t *this, dest[op_ret] = 0; - op_ret = posix_lstat_with_gen (this, real_path, &stbuf); - if (op_ret == -1) { + lstat_ret = posix_lstat_with_gen (this, real_path, &stbuf); + if (lstat_ret == -1) { + op_ret = -1; op_errno = errno; gf_log (this->name, GF_LOG_ERROR, "lstat on %s failed: %s", loc->path, -- cgit