summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-layout.c
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2017-06-26 21:12:56 +0530
committerRaghavendra Talur <rtalur@redhat.com>2017-07-19 21:34:15 +0000
commitbabde83eb1e2bb0fa072a2eb8de962c777616875 (patch)
treece9a63247c0d16d1cc23f5912a14db051d911537 /xlators/cluster/dht/src/dht-layout.c
parent904c211802e1d834ec05c21831aa5b51a416341c (diff)
cluster/dht: Check if fd is opened on dst subvol
If an fd is opened on a file, the file is migrated and the cached subvol is updated in the inode_ctx before an fd based fop is sent, the fop is sent to the dst subvol on which the fd is not opened. This causes the FOP to fail with EBADF. Now, every fd based fop will check to see that the fd has been opened on the dst subvol before winding it down. > BUG: 1465075 > Signed-off-by: N Balachandran <nbalacha@redhat.com> > Reviewed-on: https://review.gluster.org/17630 > Smoke: Gluster Build System <jenkins@build.gluster.org> > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> > Reviewed-by: Susant Palai <spalai@redhat.com> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> (cherry picked from commit 91db0d47ca267aecfc6124a3f337a4e2f2c9f1e2) Change-Id: Id92ef5eb7a5b5226688e2d2868b15e383f5f240e BUG: 1467010 Signed-off-by: N Balachandran <nbalacha@redhat.com> Reviewed-on: https://review.gluster.org/17752 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-layout.c')
-rw-r--r--xlators/cluster/dht/src/dht-layout.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-layout.c b/xlators/cluster/dht/src/dht-layout.c
index 4352ffe5756..3414dc91908 100644
--- a/xlators/cluster/dht/src/dht-layout.c
+++ b/xlators/cluster/dht/src/dht-layout.c
@@ -855,6 +855,7 @@ dht_layout_preset (xlator_t *this, xlator_t *subvol, inode_t *inode)
if (!conf)
goto out;
+
layout = dht_layout_for_subvol (this, subvol);
if (!layout) {
gf_msg (this->name, GF_LOG_INFO, 0,
@@ -865,10 +866,14 @@ dht_layout_preset (xlator_t *this, xlator_t *subvol, inode_t *inode)
goto out;
}
+ gf_msg_debug (this->name, 0, "file = %s, subvol = %s",
+ uuid_utoa (inode->gfid), subvol ? subvol->name : "<nil>");
+
LOCK (&conf->layout_lock);
{
dht_inode_ctx_layout_set (inode, this, layout);
}
+
UNLOCK (&conf->layout_lock);
ret = 0;