summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-common.c
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2017-06-26 21:12:56 +0530
committerRaghavendra G <rgowdapp@redhat.com>2017-06-28 11:42:21 +0000
commit91db0d47ca267aecfc6124a3f337a4e2f2c9f1e2 (patch)
tree283bacfb689183505a4ef3b9364739a90b123960 /xlators/cluster/dht/src/dht-common.c
parent630d3d8c8466228e1764c1c0962b9db40548fffb (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. Change-Id: Id92ef5eb7a5b5226688e2d2868b15e383f5f240e 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>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.c')
-rw-r--r--xlators/cluster/dht/src/dht-common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 8c6df4a811a..6aa9b13e37a 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -6669,6 +6669,14 @@ dht_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
postparent, 1);
}
+ ret = dht_fd_ctx_set (this, fd, prev);
+ if (ret != 0) {
+ gf_msg_debug (this->name, 0, "Possible fd leak. "
+ "Could not set fd ctx for subvol %s",
+ prev->name);
+ }
+
+
ret = dht_layout_preset (this, prev, inode);
if (ret != 0) {
gf_msg_debug (this->name, 0,