summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2009-10-18 09:58:18 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-18 08:37:14 -0700
commitaacde00714c60db438c2fdc5ebacbe60a988f60b (patch)
tree36df0493e9cef497b59475e44bf1697f3e6660d2 /xlators/storage
parentaa701e2f607902628fce196de3eb0402aede7736 (diff)
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 <avati@dev.gluster.com> BUG: 315 (generation number support) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=315
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/posix/src/posix.c10
1 files changed, 6 insertions, 4 deletions
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,