From a4c948aca6058049523e31acf33ce5770f8693ad Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Wed, 22 Sep 2010 03:32:15 +0000 Subject: distribute: Return ESTALE when dir selfheal finds no fix Signed-off-by: Shehjar Tikoo Signed-off-by: Vijay Bellur BUG: 1641 (Distribute must return error when dir selfheal has no fix) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1641 --- xlators/cluster/dht/src/dht-selfheal.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'xlators') diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index d5d9892b556..6b3e13b1afc 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -481,14 +481,16 @@ dht_selfheal_directory (call_frame_t *frame, dht_selfheal_dir_cbk_t dir_cbk, if (down) { gf_log (this->name, GF_LOG_DEBUG, "%d subvolumes down -- not fixing", down); - ret = 0; + ret = -1; + local->op_errno = ESTALE; goto sorry_no_fix; } if (misc) { gf_log (this->name, GF_LOG_DEBUG, "%d subvolumes have unrecoverable errors", misc); - ret = 0; + ret = -1; + local->op_errno = ESTALE; goto sorry_no_fix; } @@ -498,6 +500,8 @@ dht_selfheal_directory (call_frame_t *frame, dht_selfheal_dir_cbk_t dir_cbk, if (ret == -1) { gf_log (this->name, GF_LOG_DEBUG, "not able to form layout for the directory"); + ret = -1; + local->op_errno = ESTALE; goto sorry_no_fix; } -- cgit