From bfd8f92490454f261330da34565334ed5decd0e1 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Sat, 13 Feb 2016 10:02:55 +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 --- xlators/cluster/dht/src/dht-common.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xlators/cluster/dht/src') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 4c43c42750e..5886886e830 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -4619,6 +4619,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