summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec/src/ec-heal.c
diff options
context:
space:
mode:
authorXavier Hernandez <xhernandez@datalab.es>2014-11-08 21:46:41 +0100
committerRaghavendra Bhat <raghavendra@redhat.com>2015-02-11 01:37:55 -0800
commit22035d5e37db748cbdee2596d99006cea6b5282e (patch)
tree3f84db610a611e52ee8b17b9977a81ed78ea44b4 /xlators/cluster/ec/src/ec-heal.c
parent8c9526a8626dc1a7b7aac5f96ecb33991dc44237 (diff)
ec: Fix posix compliance failures
This patch solves some problems that caused dispersed volumes to not pass posix smoke tests: * Problems in open/create with O_WRONLY Opening files with -w- permissions using O_WRONLY returned an EACCES error because internally O_WRONLY was replaced with O_RDWR. * Problems with entrylk on renames. When source and destination were the same, ec tried to acquire the same entrylk twice, causing a deadlock. * Overwrite of a variable when reordering locks. On a rename, if the second lock needed to be placed at the beggining of the list, the 'lock' variable was overwritten and later its timer was cancelled, cancelling the incorrect one. * Handle O_TRUNC in open. When O_TRUNC was received in an open call, it was blindly propagated to child subvolumes. This caused a discrepancy between real file size and the size stored into trusted.ec.size xattr. This has been solved by removing O_TRUNC from open and later calling ftruncate. This is a backport of http://review.gluster.org/9420 Change-Id: I20c3d6e1c11be314be86879be54b728e01013798 BUG: 1159471 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/9501 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/cluster/ec/src/ec-heal.c')
-rw-r--r--xlators/cluster/ec/src/ec-heal.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c
index 949170db495..862d45d0cf3 100644
--- a/xlators/cluster/ec/src/ec-heal.c
+++ b/xlators/cluster/ec/src/ec-heal.c
@@ -783,7 +783,6 @@ ec_cbk_data_t * ec_heal_lookup_check(ec_heal_t * heal, uintptr_t * pgood,
void ec_heal_prepare(ec_heal_t * heal)
{
ec_cbk_data_t * cbk;
- ec_fd_t * ctx;
int32_t error = ENOMEM;
heal->available = heal->good;
@@ -814,13 +813,6 @@ void ec_heal_prepare(ec_heal_t * heal)
goto out;
}
- ctx = ec_fd_get(heal->fd, heal->xl);
- if ((ctx == NULL) || (loc_copy(&ctx->loc, &heal->loc) != 0))
- {
- goto out;
- }
-
- ctx->flags = O_RDWR;
}
if (heal->iatt.ia_type == IA_IFLNK)
@@ -1057,11 +1049,6 @@ void ec_heal_reopen_fd(ec_heal_t * heal)
else
{
flags = ctx_fd->flags & ~(O_TRUNC | O_APPEND);
- if ((flags & O_ACCMODE) == O_WRONLY)
- {
- flags &= ~O_ACCMODE;
- flags |= O_RDWR;
- }
ec_open(heal->fop->frame, heal->xl, mask, EC_MINIMUM_ONE,
ec_heal_reopen_cbk, NULL, &heal->loc, flags, fd,