diff options
author | N Balachandran <nbalacha@redhat.com> | 2016-02-15 10:24:05 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2016-02-21 18:37:03 -0800 |
commit | e5c24b4040d1fe11d92194b4e2277e0587f85e2e (patch) | |
tree | 8faf2bb9154d2939f5d111cf2d8ba56d27743d28 /xlators/cluster | |
parent | 8856c9f475bc8cf0581d56227497f10eb5ddb0be (diff) |
cluster/dht: Skip subvols if no layout present
Running "rm -rf" on a tiered volume sometimes caused
the client to crash because dht_readdirp_cbk referenced
a NULL layout for the hot tier subvol.
Now, entries are skipped if the layout is NULL. This
can cause "rm -rf" to fail with ENOTEMPTY rmdir failures.
> Change-Id: Idd71a9d0f7ee712899cc7113bbf2cd3dcb25808b
> BUG: 1307208
> Signed-off-by: N Balachandran <nbalacha@redhat.com>
> Reviewed-on: http://review.gluster.org/13440
> Smoke: Gluster Build System <jenkins@build.gluster.com>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> Reviewed-by: Dan Lambright <dlambrig@redhat.com>
> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
(cherry picked from commit bfd8f92490454f261330da34565334ed5decd0e1)
Change-Id: I34e413d669fdfba343446e84fef5d8e9dd7bd1da
BUG: 1308400
Signed-off-by: N Balachandran <nbalacha@redhat.com>
Reviewed-on: http://review.gluster.org/13441
Smoke: Gluster Build System <jenkins@build.gluster.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 8 |
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 22c3edd15aa..b65fe9077ee 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -4611,6 +4611,14 @@ dht_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, layout = local->layout; + /* We have seen crashes in while running "rm -rf" on tier volumes + when the layout was NULL on the hot tier. This will skip the + entries on the subvol without a layout, hence preventing the crash + but rmdir might fail with "directory not empty" errors*/ + + if (layout == NULL) + goto done; + if (conf->readdir_optimize == _gf_true) readdir_optimize = 1; |