summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec/src/ec-helpers.c
diff options
context:
space:
mode:
authorXavier Hernandez <xhernandez@datalab.es>2014-07-08 17:52:57 +0200
committerVijay Bellur <vbellur@redhat.com>2014-08-02 00:23:24 -0700
commitf3204a06eb8156743110b1613b4b4b63b70572b6 (patch)
tree5123ac07ca0fa0d540f7193c2dcb978c4a0065f1 /xlators/cluster/ec/src/ec-helpers.c
parentd9fbc8518962c8607cc741626c2e197098e749b5 (diff)
cluster/ec: Fix incorrect management of NFS requests
Some operations, specially those comming from NFS, do not use a regular fd and use an anonymous fd (i.e. a previous open call has not been sent). Any context information created during open or create will not be present on these fd's, so we simply return NULL for contexts of those fd. Also it seems that NFS can send write requests with a very big buffer (higher that the default value of 128 KB). Some changes have been made to correctly handle these large buffers. Change-Id: I281476bd0d2cbaad231822248d6a616fcf5d4003 BUG: 1122417 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/8367 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/ec/src/ec-helpers.c')
-rw-r--r--xlators/cluster/ec/src/ec-helpers.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/xlators/cluster/ec/src/ec-helpers.c b/xlators/cluster/ec/src/ec-helpers.c
index cd0ac41ebe7..6eb836a1c62 100644
--- a/xlators/cluster/ec/src/ec-helpers.c
+++ b/xlators/cluster/ec/src/ec-helpers.c
@@ -531,6 +531,11 @@ ec_fd_t * __ec_fd_get(fd_t * fd, xlator_t * xl)
ec_fd_t * ctx = NULL;
uint64_t value = 0;
+ if (fd->anonymous)
+ {
+ return NULL;
+ }
+
if ((__fd_ctx_get(fd, xl, &value) != 0) || (value == 0))
{
ctx = GF_MALLOC(sizeof(*ctx), ec_mt_ec_fd_t);
@@ -559,11 +564,14 @@ ec_fd_t * ec_fd_get(fd_t * fd, xlator_t * xl)
{
ec_fd_t * ctx = NULL;
- LOCK(&fd->lock);
+ if (!fd->anonymous)
+ {
+ LOCK(&fd->lock);
- ctx = __ec_fd_get(fd, xl);
+ ctx = __ec_fd_get(fd, xl);
- UNLOCK(&fd->lock);
+ UNLOCK(&fd->lock);
+ }
return ctx;
}