diff options
author | Susant Palai <spalai@redhat.com> | 2014-01-29 10:47:20 +0000 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2014-02-08 11:29:18 -0800 |
commit | 14792bd894e7838efdc8f50a16af5445b448dc2e (patch) | |
tree | f72f744929edb6dd5b73220eb4685bcfb62aa3ec /xlators/cluster/dht | |
parent | 7e06ec5b1ed6ecab8853065c9ea0dd7c1c0c58f0 (diff) |
cluster/dht: If hashed_subvol is NULL, do not fail
Problem: With the current implementation we are allowing unlink
of a file if hashed subvol is down and cached subvol is up.
For the above op to work we should have the info of hashed_subvol.
But incase we do remount of the volume we will have a zeroed layout
for the disconnected subvol(start=0, stop=0, err=ENOTCONN) which will
result into hashed_subvol being NULL and failing unlink op.
Solution: Dont fail if hashed_subvol is NULL. Check cached subvol
and unlink in cached subvol. The linkto file in the hashed subvol
can be remove later.
Change-Id: Ic1982c15c8942a1adcb47ed0017d2d5ace5c9241
BUG: 983416
Signed-off-by: Susant Palai <spalai@redhat.com>
Reviewed-on: http://review.gluster.org/6851
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index aba56723353..3055f4615cf 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -3717,12 +3717,12 @@ dht_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, } hashed_subvol = dht_subvol_get_hashed (this, loc); + /* Dont fail unlink if hashed_subvol is NULL which can be the result + * of layout anomaly */ if (!hashed_subvol) { gf_log (this->name, GF_LOG_DEBUG, "no subvolume in layout for path=%s", loc->path); - op_errno = EINVAL; - goto err; } cached_subvol = local->cached_subvol; @@ -3734,7 +3734,7 @@ dht_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, } local->flags = xflag; - if (hashed_subvol != cached_subvol) { + if (hashed_subvol && hashed_subvol != cached_subvol) { STACK_WIND (frame, dht_unlink_linkfile_cbk, hashed_subvol, hashed_subvol->fops->unlink, loc, xflag, xdata); |