|
|
14f8ab |
From 220b95085847b5f6a9e5bee7a9519efe72600e6a Mon Sep 17 00:00:00 2001
|
|
|
14f8ab |
From: Pranith Kumar K <pkarampu@redhat.com>
|
|
|
14f8ab |
Date: Thu, 18 Jul 2019 11:25:31 +0530
|
|
|
14f8ab |
Subject: [PATCH 272/276] cluster/ec: Always read from good-mask
|
|
|
14f8ab |
|
|
|
14f8ab |
There are cases where fop->mask may have fop->healing added
|
|
|
14f8ab |
and readv shouldn't be wound on fop->healing. To avoid this
|
|
|
14f8ab |
always wind readv to lock->good_mask
|
|
|
14f8ab |
|
|
|
14f8ab |
Upstream-patch: https://review.gluster.org/c/glusterfs/+/23069
|
|
|
14f8ab |
fixes: bz#1730914
|
|
|
14f8ab |
Change-Id: I2226ef0229daf5ff315d51e868b980ee48060b87
|
|
|
14f8ab |
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
|
|
|
14f8ab |
Reviewed-on: https://code.engineering.redhat.com/gerrit/177976
|
|
|
14f8ab |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
14f8ab |
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
|
|
14f8ab |
---
|
|
|
14f8ab |
xlators/cluster/ec/src/ec-common.c | 3 +++
|
|
|
14f8ab |
xlators/cluster/ec/src/ec-inode-write.c | 27 ++++++++++++++++++++++-----
|
|
|
14f8ab |
2 files changed, 25 insertions(+), 5 deletions(-)
|
|
|
14f8ab |
|
|
|
14f8ab |
diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c
|
|
|
14f8ab |
index db1ff5b..28b31c9 100644
|
|
|
14f8ab |
--- a/xlators/cluster/ec/src/ec-common.c
|
|
|
14f8ab |
+++ b/xlators/cluster/ec/src/ec-common.c
|
|
|
14f8ab |
@@ -654,6 +654,9 @@ ec_child_select(ec_fop_data_t *fop)
|
|
|
14f8ab |
* unlock should go on all subvols where lock is performed*/
|
|
|
14f8ab |
if (fop->parent && !ec_internal_op(fop)) {
|
|
|
14f8ab |
fop->mask &= (fop->parent->mask & ~fop->parent->healing);
|
|
|
14f8ab |
+ if (ec_is_data_fop(fop->id)) {
|
|
|
14f8ab |
+ fop->healing |= fop->parent->healing;
|
|
|
14f8ab |
+ }
|
|
|
14f8ab |
}
|
|
|
14f8ab |
|
|
|
14f8ab |
if ((fop->mask & ~ec->xl_up) != 0) {
|
|
|
14f8ab |
diff --git a/xlators/cluster/ec/src/ec-inode-write.c b/xlators/cluster/ec/src/ec-inode-write.c
|
|
|
14f8ab |
index a45e6d6..4f35b6d 100644
|
|
|
14f8ab |
--- a/xlators/cluster/ec/src/ec-inode-write.c
|
|
|
14f8ab |
+++ b/xlators/cluster/ec/src/ec-inode-write.c
|
|
|
14f8ab |
@@ -1977,6 +1977,20 @@ ec_get_and_merge_stripe(ec_t *ec, ec_fop_data_t *fop, ec_stripe_part_t which)
|
|
|
14f8ab |
return found;
|
|
|
14f8ab |
}
|
|
|
14f8ab |
|
|
|
14f8ab |
+static uintptr_t
|
|
|
14f8ab |
+ec_get_lock_good_mask(inode_t *inode, xlator_t *xl)
|
|
|
14f8ab |
+{
|
|
|
14f8ab |
+ ec_lock_t *lock = NULL;
|
|
|
14f8ab |
+ ec_inode_t *ictx = NULL;
|
|
|
14f8ab |
+ LOCK(&inode->lock);
|
|
|
14f8ab |
+ {
|
|
|
14f8ab |
+ ictx = __ec_inode_get(inode, xl);
|
|
|
14f8ab |
+ lock = ictx->inode_lock;
|
|
|
14f8ab |
+ }
|
|
|
14f8ab |
+ UNLOCK(&inode->lock);
|
|
|
14f8ab |
+ return lock->good_mask;
|
|
|
14f8ab |
+}
|
|
|
14f8ab |
+
|
|
|
14f8ab |
void
|
|
|
14f8ab |
ec_writev_start(ec_fop_data_t *fop)
|
|
|
14f8ab |
{
|
|
|
14f8ab |
@@ -2022,9 +2036,10 @@ ec_writev_start(ec_fop_data_t *fop)
|
|
|
14f8ab |
err = -ENOMEM;
|
|
|
14f8ab |
goto failed_xdata;
|
|
|
14f8ab |
}
|
|
|
14f8ab |
- ec_readv(fop->frame, fop->xl, -1, EC_MINIMUM_MIN,
|
|
|
14f8ab |
- ec_writev_merge_head, NULL, fd, ec->stripe_size,
|
|
|
14f8ab |
- fop->offset, 0, xdata);
|
|
|
14f8ab |
+ ec_readv(fop->frame, fop->xl,
|
|
|
14f8ab |
+ ec_get_lock_good_mask(fop->fd->inode, fop->xl),
|
|
|
14f8ab |
+ EC_MINIMUM_MIN, ec_writev_merge_head, NULL, fd,
|
|
|
14f8ab |
+ ec->stripe_size, fop->offset, 0, xdata);
|
|
|
14f8ab |
}
|
|
|
14f8ab |
} else {
|
|
|
14f8ab |
memset(fop->vector[0].iov_base, 0, fop->head);
|
|
|
14f8ab |
@@ -2047,8 +2062,10 @@ ec_writev_start(ec_fop_data_t *fop)
|
|
|
14f8ab |
err = -ENOMEM;
|
|
|
14f8ab |
goto failed_xdata;
|
|
|
14f8ab |
}
|
|
|
14f8ab |
- ec_readv(fop->frame, fop->xl, -1, EC_MINIMUM_MIN,
|
|
|
14f8ab |
- ec_writev_merge_tail, NULL, fd, ec->stripe_size,
|
|
|
14f8ab |
+ ec_readv(fop->frame, fop->xl,
|
|
|
14f8ab |
+ ec_get_lock_good_mask(fop->fd->inode, fop->xl),
|
|
|
14f8ab |
+ EC_MINIMUM_MIN, ec_writev_merge_tail, NULL, fd,
|
|
|
14f8ab |
+ ec->stripe_size,
|
|
|
14f8ab |
fop->offset + fop->size - ec->stripe_size, 0, xdata);
|
|
|
14f8ab |
}
|
|
|
14f8ab |
} else {
|
|
|
14f8ab |
--
|
|
|
14f8ab |
1.8.3.1
|
|
|
14f8ab |
|