From 386f1d7926e4497fc2a905367ade2e3f6972eba7 Mon Sep 17 00:00:00 2001 From: Raghavendra Gowdappa Date: Thu, 11 Oct 2018 16:22:28 +0530 Subject: cluster/dht: fixes to unlinking invalid linkto file If unlinking of an invalid linkto file failed in lookup-everywhere codepath, lookup was failed with EIO. The rational as per the comment was, /* When dht_lookup_everywhere is performed, one cached *and one hashed file was found and hashed file does *not point to the above mentioned cached node. So it *was considered as stale and an unlink was performed. *But unlink fails. So may be rebalance is in progress. *now ideally we have two data-files. One obtained during *lookup_everywhere and one where unlink-failed. So *at this point in time we cannot decide which one to *choose because there are chances of first cached *file is truncated after rebalance and if it is chosen *as cached node, application will fail. So return EIO. */ However, this reasoning is only valid when * op_errno is EBUSY, indicating rebalance is in progress * op_errno is ENOTCONN as wecannot determine what was the status of file on brick. Hence this patch doesn't fail lookup unless unlink fails with an either EBUSY or ENOTCONN Change-Id: Ife55f3d97fe557f3db05beae0c2d786df31e8e55 Fixes: bz#1635145 Signed-off-by: Raghavendra Gowdappa --- xlators/cluster/dht/src/dht-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index a94f904323c..808b4ceb6e5 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -1980,7 +1980,7 @@ dht_lookup_unlink_of_false_linkto_cbk(call_frame_t *frame, void *cookie, this_call_cnt = dht_frame_return(frame); if (is_last_call(this_call_cnt)) { - if (op_ret == 0) { + if ((op_ret == 0) || ((op_errno != EBUSY) && (op_errno != ENOTCONN))) { dht_lookup_everywhere_done(frame, this); } else { /*When dht_lookup_everywhere is performed, one cached -- cgit