path: root/xlators
diff options
authorRaghavendra Gowdappa <>2018-10-11 16:22:28 +0530
committerAmar Tumballi <>2018-10-16 05:10:05 +0000
commit386f1d7926e4497fc2a905367ade2e3f6972eba7 (patch)
treeac05eeff74406df557c7be551741c52efa5a3b57 /xlators
parent7152ace0b3586289be068f09e2c20cf0a8d2d166 (diff)
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, <snip> /* 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. */ </snip> 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 <>
Diffstat (limited to 'xlators')
1 files changed, 1 insertions, 1 deletions
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