summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-11-07 16:32:10 +0530
committerVijay Bellur <vijay@gluster.com>2011-11-08 22:11:48 -0800
commitd4c61c4fff1c9e8d32d84eb1a552c9070bdc2c6f (patch)
tree6d4afa9e8ebfe3e74fea5daaca14037c4272b12c
parentbff2fe53d51bcf9b3dbf97fc5a0d25ab3d452738 (diff)
stripe read: Wipe stat in reply to prevent truncated error.
If the read request, does not fall to the subvolume with the largest file size set, then we never return the correct size. This leads to clients seeing a truncated file error. The work around is to wipe stat being returned as part of read call. Change-Id: I4e76d09d7919fd0be616fe140e08f89a0dbcc444 BUG: 3774 Reviewed-on: http://review.gluster.com/682 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
-rw-r--r--libglusterfs/src/common-utils.h2
-rw-r--r--xlators/cluster/dht/src/dht-common.h1
-rw-r--r--xlators/cluster/stripe/src/stripe.c2
3 files changed, 4 insertions, 1 deletions
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index e4d30297002..272beee2d77 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -70,6 +70,8 @@ void trap (void);
#define GEOREP "geo-replication"
+#define WIPE(statp) do { typeof(*statp) z = {0,}; if (statp) *statp = z; } while (0)
+
enum _gf_boolean
{
_gf_false = 0,
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h
index 437e0dff3dd..c9e4e926101 100644
--- a/xlators/cluster/dht/src/dht-common.h
+++ b/xlators/cluster/dht/src/dht-common.h
@@ -181,7 +181,6 @@ struct dht_disk_layout {
};
typedef struct dht_disk_layout dht_disk_layout_t;
-#define WIPE(statp) do { typeof(*statp) z = {0,}; if (statp) *statp = z; } while (0)
#define ENTRY_MISSING(op_ret, op_errno) (op_ret == -1 && op_errno == ENOENT)
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index d42d88b1202..e6175c20374 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -3622,6 +3622,8 @@ stripe_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
/* */
GF_FREE (mlocal->replies);
tmp_iobref = mlocal->iobref;
+ /* work around for nfs truncated read. Bug 3774 */
+ WIPE (&tmp_stbuf);
STRIPE_STACK_UNWIND (readv, mframe, op_ret, op_errno, final_vec,
final_count, &tmp_stbuf, tmp_iobref);