diff options
author | Susant Palai <spalai@redhat.com> | 2014-05-13 12:56:17 -0400 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-06-16 05:14:20 -0700 |
commit | b8f3aab95f01ac7d590a5ba490e890d9cf8c2e50 (patch) | |
tree | 87e346c84680c8acdee38464014d04c0e9974d86 /xlators/cluster/dht/src/dht-helper.c | |
parent | 62265f40d7201854dbf33d59a74286dda671a129 (diff) |
DHT/readdirp: Directory not shown/healed on mount point if exists
on single brick(non first up subvolume).
Problem: If snapshot is taken, when mkdir has succeeded only on
hashed_subvolume, then after restoring snapshot the directory
is not shown on mount point.
Why: dht_readdirp takes only those directory entries in to
account, which are present on first_up_subvolume. Hence, if the
"hashed subvolume" is not same as first_up_subvolume, it wont be listed
on mount point and also not healed.
Solution:
Case 1: (Rebalance not running)If hashed subvolume is NULL or down then
filter in first_up_subvolume. Other wise the corresponding hashed subvolume
will take care of the directory entry.
Case 2: If readdirp_optimize option is turned on then read from first_up_subvol
Change-Id: Idaad28f1c9f688dbfb1a8a3ab8b244510c02365e
BUG: 1092433
Signed-off-by: Susant Palai <spalai@redhat.com>
Reviewed-on: http://review.gluster.org/7599
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-helper.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-helper.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index f1dc5072f40..58af04db392 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -1204,3 +1204,16 @@ int dht_inode_ctx_set (inode_t *inode, xlator_t *this, dht_inode_ctx_t *ctx) out: return ret; } + +int +dht_subvol_status (dht_conf_t *conf, xlator_t *subvol) +{ + int i; + + for (i=0 ; i < conf->subvolume_cnt; i++) { + if (conf->subvolumes[i] == subvol) { + return conf->subvolume_status[i]; + } + } + return 0; +} |