From c2fbcb6140585d9fc82367a9101857bf5d05d732 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Wed, 16 Dec 2015 21:09:22 +0530 Subject: cluster/dht : Ftruncate on migrating file fails with EINVAL What: If dht_open is called on a migrating file after the inode_ctx is set, subsequent FOPs on that fd do not open the fd on the dst subvol. This is seen when the open-ftruncate-close sequence is repeatedly called on a migrating file. A second call to the sequence described above causes dht_truncate_cbk to call dht_truncate2 as the dht_inode_ctx was already set by the first call. As dht_rebalance_in_progress_check is not called, the fd is not opened on the dst subvol. On a distributed-replicate volume, this causes AFR to open the fd using afr_fix_open, but with the wrong flags, causing posix_ftruncate to fail with EINVAL. The fix: We require fd specific information to make a decision while handling migrating files. Set the fd_ctx to indicate the fd has been opened on the dst subvol and check if it has been set while processing Phase1/Phase2 checks in the FOP callback functions. > Change-Id: I43cdcd8017b4a11e18afdd210469de7cd9a5ef14 > Signed-off-by: N Balachandran > Reviewed-on: http://review.gluster.org/12985 > Reviewed-by: Raghavendra G > Tested-by: Gluster Build System > Reviewed-by: Dan Lambright > Tested-by: Dan Lambright Change-Id: I99f8aceec105f16631def06a263f0561954d14b3 BUG: 1293827 Signed-off-by: N Balachandran Reviewed-on: http://review.gluster.org/13071 Reviewed-by: Pranith Kumar Karampuri Tested-by: Pranith Kumar Karampuri Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System --- xlators/cluster/dht/src/dht.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/cluster/dht/src/dht.c') diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c index c67172cc926..fa438f3780f 100644 --- a/xlators/cluster/dht/src/dht.c +++ b/xlators/cluster/dht/src/dht.c @@ -82,7 +82,7 @@ struct xlator_dumpops dumpops = { struct xlator_cbks cbks = { -// .release = dht_release, + .release = dht_release, // .releasedir = dht_releasedir, .forget = dht_forget }; -- cgit