From e5c24b4040d1fe11d92194b4e2277e0587f85e2e Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Mon, 15 Feb 2016 10:24:05 +0530 Subject: 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 > Reviewed-on: http://review.gluster.org/13440 > Smoke: Gluster Build System > CentOS-regression: Gluster Build System > NetBSD-regression: NetBSD Build System > Reviewed-by: Dan Lambright > Reviewed-by: Raghavendra G (cherry picked from commit bfd8f92490454f261330da34565334ed5decd0e1) Change-Id: I34e413d669fdfba343446e84fef5d8e9dd7bd1da BUG: 1308400 Signed-off-by: N Balachandran Reviewed-on: http://review.gluster.org/13441 Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Raghavendra G --- xlators/cluster/dht/src/dht-common.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xlators') 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; -- cgit