Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 1 | /* |
| 2 | * (C) 2001 Clemson University and The University of Chicago |
| 3 | * (C) 2011 Omnibond Systems |
| 4 | * |
| 5 | * Changes by Acxiom Corporation to implement generic service_operation() |
| 6 | * function, Copyright Acxiom Corporation, 2005. |
| 7 | * |
| 8 | * See COPYING in top-level directory. |
| 9 | */ |
| 10 | |
| 11 | /* |
| 12 | * In-kernel waitqueue operations. |
| 13 | */ |
| 14 | |
| 15 | #include "protocol.h" |
Mike Marshall | 575e946 | 2015-12-04 12:56:14 -0500 | [diff] [blame] | 16 | #include "orangefs-kernel.h" |
| 17 | #include "orangefs-bufmap.h" |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 18 | |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 19 | static int wait_for_matching_downcall(struct orangefs_kernel_op_s *, long, bool); |
Al Viro | d2d87a3 | 2016-02-13 10:15:22 -0500 | [diff] [blame] | 20 | static void orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *); |
Al Viro | ade3d78 | 2016-01-21 22:58:58 -0500 | [diff] [blame] | 21 | |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 22 | /* |
| 23 | * What we do in this function is to walk the list of operations that are |
| 24 | * present in the request queue and mark them as purged. |
| 25 | * NOTE: This is called from the device close after client-core has |
| 26 | * guaranteed that no new operations could appear on the list since the |
| 27 | * client-core is anyway going to exit. |
| 28 | */ |
| 29 | void purge_waiting_ops(void) |
| 30 | { |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 31 | struct orangefs_kernel_op_s *op; |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 32 | |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 33 | spin_lock(&orangefs_request_list_lock); |
| 34 | list_for_each_entry(op, &orangefs_request_list, list) { |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 35 | gossip_debug(GOSSIP_WAIT_DEBUG, |
| 36 | "pvfs2-client-core: purging op tag %llu %s\n", |
| 37 | llu(op->tag), |
| 38 | get_opname_string(op)); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 39 | set_op_state_purged(op); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 40 | } |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 41 | spin_unlock(&orangefs_request_list_lock); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | /* |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 45 | * submits a ORANGEFS operation and waits for it to complete |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 46 | * |
| 47 | * Note op->downcall.status will contain the status of the operation (in |
| 48 | * errno format), whether provided by pvfs2-client or a result of failure to |
| 49 | * service the operation. If the caller wishes to distinguish, then |
| 50 | * op->state can be checked to see if it was serviced or not. |
| 51 | * |
| 52 | * Returns contents of op->downcall.status for convenience |
| 53 | */ |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 54 | int service_operation(struct orangefs_kernel_op_s *op, |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 55 | const char *op_name, |
| 56 | int flags) |
| 57 | { |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 58 | long timeout = MAX_SCHEDULE_TIMEOUT; |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 59 | int ret = 0; |
| 60 | |
Mike Marshall | ce6c414 | 2015-12-14 14:54:46 -0500 | [diff] [blame] | 61 | DEFINE_WAIT(wait_entry); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 62 | |
| 63 | op->upcall.tgid = current->tgid; |
| 64 | op->upcall.pid = current->pid; |
| 65 | |
| 66 | retry_servicing: |
| 67 | op->downcall.status = 0; |
| 68 | gossip_debug(GOSSIP_WAIT_DEBUG, |
Mike Marshall | 5253487 | 2016-02-16 17:09:09 -0500 | [diff] [blame] | 69 | "%s: %s op:%p: process:%s: pid:%d:\n", |
| 70 | __func__, |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 71 | op_name, |
Mike Marshall | 5253487 | 2016-02-16 17:09:09 -0500 | [diff] [blame] | 72 | op, |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 73 | current->comm, |
| 74 | current->pid); |
| 75 | |
Mike Marshall | adcf34a | 2016-02-24 16:54:27 -0500 | [diff] [blame^] | 76 | /* |
| 77 | * If ORANGEFS_OP_NO_MUTEX was set in flags, we need to avoid |
| 78 | * aquiring the request_mutex because we're servicing a |
| 79 | * high priority remount operation and the request_mutex is |
| 80 | * already taken. |
| 81 | */ |
| 82 | if (!(flags & ORANGEFS_OP_NO_MUTEX)) { |
Al Viro | c72f15b | 2016-02-13 10:49:24 -0500 | [diff] [blame] | 83 | if (flags & ORANGEFS_OP_INTERRUPTIBLE) |
| 84 | ret = mutex_lock_interruptible(&request_mutex); |
| 85 | else |
| 86 | ret = mutex_lock_killable(&request_mutex); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 87 | /* |
| 88 | * check to see if we were interrupted while waiting for |
Mike Marshall | adcf34a | 2016-02-24 16:54:27 -0500 | [diff] [blame^] | 89 | * mutex |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 90 | */ |
| 91 | if (ret < 0) { |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 92 | op->downcall.status = ret; |
| 93 | gossip_debug(GOSSIP_WAIT_DEBUG, |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 94 | "orangefs: service_operation interrupted.\n"); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 95 | return ret; |
| 96 | } |
| 97 | } |
| 98 | |
Al Viro | 98815ad | 2016-02-13 10:38:23 -0500 | [diff] [blame] | 99 | /* queue up the operation */ |
| 100 | spin_lock(&orangefs_request_list_lock); |
| 101 | spin_lock(&op->lock); |
| 102 | set_op_state_waiting(op); |
Mike Marshall | adcf34a | 2016-02-24 16:54:27 -0500 | [diff] [blame^] | 103 | /* add high priority remount op to the front of the line. */ |
Al Viro | 98815ad | 2016-02-13 10:38:23 -0500 | [diff] [blame] | 104 | if (flags & ORANGEFS_OP_PRIORITY) |
| 105 | list_add(&op->list, &orangefs_request_list); |
| 106 | else |
| 107 | list_add_tail(&op->list, &orangefs_request_list); |
| 108 | spin_unlock(&op->lock); |
| 109 | wake_up_interruptible(&orangefs_request_list_waitq); |
| 110 | if (!__is_daemon_in_service()) { |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 111 | gossip_debug(GOSSIP_WAIT_DEBUG, |
Al Viro | 98815ad | 2016-02-13 10:38:23 -0500 | [diff] [blame] | 112 | "%s:client core is NOT in service.\n", |
| 113 | __func__); |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 114 | timeout = op_timeout_secs * HZ; |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 115 | } |
Al Viro | 98815ad | 2016-02-13 10:38:23 -0500 | [diff] [blame] | 116 | spin_unlock(&orangefs_request_list_lock); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 117 | |
Mike Marshall | adcf34a | 2016-02-24 16:54:27 -0500 | [diff] [blame^] | 118 | if (!(flags & ORANGEFS_OP_NO_MUTEX)) |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 119 | mutex_unlock(&request_mutex); |
| 120 | |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 121 | ret = wait_for_matching_downcall(op, timeout, |
| 122 | flags & ORANGEFS_OP_INTERRUPTIBLE); |
Mike Marshall | 5253487 | 2016-02-16 17:09:09 -0500 | [diff] [blame] | 123 | |
| 124 | gossip_debug(GOSSIP_WAIT_DEBUG, |
| 125 | "%s: wait_for_matching_downcall returned %d for %p\n", |
| 126 | __func__, |
| 127 | ret, |
| 128 | op); |
| 129 | |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 130 | if (!ret) { |
Al Viro | d2d87a3 | 2016-02-13 10:15:22 -0500 | [diff] [blame] | 131 | spin_unlock(&op->lock); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 132 | /* got matching downcall; make sure status is in errno format */ |
| 133 | op->downcall.status = |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 134 | orangefs_normalize_to_errno(op->downcall.status); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 135 | ret = op->downcall.status; |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 136 | goto out; |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 137 | } |
| 138 | |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 139 | /* failed to get matching downcall */ |
| 140 | if (ret == -ETIMEDOUT) { |
Mike Marshall | adcf34a | 2016-02-24 16:54:27 -0500 | [diff] [blame^] | 141 | gossip_err("%s: %s -- wait timed out; aborting attempt.\n", |
| 142 | __func__, |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 143 | op_name); |
| 144 | } |
Mike Marshall | adcf34a | 2016-02-24 16:54:27 -0500 | [diff] [blame^] | 145 | |
| 146 | /* |
| 147 | * remove waiting ops from the request list or |
| 148 | * remove in-progress ops from the in-progress list. |
| 149 | */ |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 150 | orangefs_clean_up_interrupted_operation(op); |
Mike Marshall | adcf34a | 2016-02-24 16:54:27 -0500 | [diff] [blame^] | 151 | |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 152 | op->downcall.status = ret; |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 153 | /* retry if operation has not been serviced and if requested */ |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 154 | if (ret == -EAGAIN) { |
| 155 | op->attempts++; |
| 156 | timeout = op_timeout_secs * HZ; |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 157 | gossip_debug(GOSSIP_WAIT_DEBUG, |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 158 | "orangefs: tag %llu (%s)" |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 159 | " -- operation to be retried (%d attempt)\n", |
| 160 | llu(op->tag), |
| 161 | op_name, |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 162 | op->attempts); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 163 | |
Mike Marshall | adcf34a | 2016-02-24 16:54:27 -0500 | [diff] [blame^] | 164 | /* |
| 165 | * io ops (ops that use the shared memory buffer) have |
| 166 | * to be returned to their caller for a retry. Other ops |
| 167 | * can just be recycled here. |
| 168 | */ |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 169 | if (!op->uses_shared_memory) |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 170 | goto retry_servicing; |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 171 | } |
| 172 | |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 173 | out: |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 174 | gossip_debug(GOSSIP_WAIT_DEBUG, |
Yi Liu | 8bb8aef | 2015-11-24 15:12:14 -0500 | [diff] [blame] | 175 | "orangefs: service_operation %s returning: %d for %p.\n", |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 176 | op_name, |
| 177 | ret, |
| 178 | op); |
| 179 | return ret; |
| 180 | } |
| 181 | |
Al Viro | 78699e2 | 2016-02-11 23:07:19 -0500 | [diff] [blame] | 182 | bool orangefs_cancel_op_in_progress(struct orangefs_kernel_op_s *op) |
| 183 | { |
| 184 | u64 tag = op->tag; |
| 185 | if (!op_state_in_progress(op)) |
| 186 | return false; |
| 187 | |
| 188 | op->slot_to_free = op->upcall.req.io.buf_index; |
| 189 | memset(&op->upcall, 0, sizeof(op->upcall)); |
| 190 | memset(&op->downcall, 0, sizeof(op->downcall)); |
| 191 | op->upcall.type = ORANGEFS_VFS_OP_CANCEL; |
| 192 | op->upcall.req.cancel.op_tag = tag; |
| 193 | op->downcall.type = ORANGEFS_VFS_OP_INVALID; |
| 194 | op->downcall.status = -1; |
| 195 | orangefs_new_tag(op); |
| 196 | |
| 197 | spin_lock(&orangefs_request_list_lock); |
| 198 | /* orangefs_request_list_lock is enough of a barrier here */ |
| 199 | if (!__is_daemon_in_service()) { |
| 200 | spin_unlock(&orangefs_request_list_lock); |
| 201 | return false; |
| 202 | } |
Al Viro | 98815ad | 2016-02-13 10:38:23 -0500 | [diff] [blame] | 203 | spin_lock(&op->lock); |
| 204 | set_op_state_waiting(op); |
| 205 | list_add(&op->list, &orangefs_request_list); |
| 206 | spin_unlock(&op->lock); |
Al Viro | 78699e2 | 2016-02-11 23:07:19 -0500 | [diff] [blame] | 207 | spin_unlock(&orangefs_request_list_lock); |
| 208 | |
| 209 | gossip_debug(GOSSIP_UTILS_DEBUG, |
| 210 | "Attempting ORANGEFS operation cancellation of tag %llu\n", |
| 211 | llu(tag)); |
| 212 | return true; |
| 213 | } |
| 214 | |
Al Viro | e07db0a | 2016-01-21 22:21:41 -0500 | [diff] [blame] | 215 | static void orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *op) |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 216 | { |
| 217 | /* |
| 218 | * handle interrupted cases depending on what state we were in when |
| 219 | * the interruption is detected. there is a coarse grained lock |
| 220 | * across the operation. |
| 221 | * |
Al Viro | eab9b38 | 2016-01-23 13:09:05 -0500 | [diff] [blame] | 222 | * Called with op->lock held. |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 223 | */ |
Al Viro | ed42fe0 | 2016-01-22 19:47:47 -0500 | [diff] [blame] | 224 | op->op_state |= OP_VFS_STATE_GIVEN_UP; |
Al Viro | 05a50a5 | 2016-02-18 18:59:44 -0500 | [diff] [blame] | 225 | /* from that point on it can't be moved by anybody else */ |
| 226 | if (list_empty(&op->list)) { |
| 227 | /* caught copying to/from daemon */ |
| 228 | BUG_ON(op_state_serviced(op)); |
| 229 | spin_unlock(&op->lock); |
| 230 | wait_for_completion(&op->waitq); |
| 231 | } else if (op_state_waiting(op)) { |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 232 | /* |
| 233 | * upcall hasn't been read; remove op from upcall request |
| 234 | * list. |
| 235 | */ |
| 236 | spin_unlock(&op->lock); |
Al Viro | ed42fe0 | 2016-01-22 19:47:47 -0500 | [diff] [blame] | 237 | spin_lock(&orangefs_request_list_lock); |
Al Viro | 05a50a5 | 2016-02-18 18:59:44 -0500 | [diff] [blame] | 238 | list_del_init(&op->list); |
Al Viro | ed42fe0 | 2016-01-22 19:47:47 -0500 | [diff] [blame] | 239 | spin_unlock(&orangefs_request_list_lock); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 240 | gossip_debug(GOSSIP_WAIT_DEBUG, |
| 241 | "Interrupted: Removed op %p from request_list\n", |
| 242 | op); |
| 243 | } else if (op_state_in_progress(op)) { |
| 244 | /* op must be removed from the in progress htable */ |
| 245 | spin_unlock(&op->lock); |
| 246 | spin_lock(&htable_ops_in_progress_lock); |
Al Viro | 05a50a5 | 2016-02-18 18:59:44 -0500 | [diff] [blame] | 247 | list_del_init(&op->list); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 248 | spin_unlock(&htable_ops_in_progress_lock); |
| 249 | gossip_debug(GOSSIP_WAIT_DEBUG, |
| 250 | "Interrupted: Removed op %p" |
| 251 | " from htable_ops_in_progress\n", |
| 252 | op); |
Al Viro | 05a50a5 | 2016-02-18 18:59:44 -0500 | [diff] [blame] | 253 | } else { |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 254 | spin_unlock(&op->lock); |
| 255 | gossip_err("interrupted operation is in a weird state 0x%x\n", |
| 256 | op->op_state); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 257 | } |
Al Viro | d2d87a3 | 2016-02-13 10:15:22 -0500 | [diff] [blame] | 258 | reinit_completion(&op->waitq); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | /* |
| 262 | * sleeps on waitqueue waiting for matching downcall. |
| 263 | * if client-core finishes servicing, then we are good to go. |
| 264 | * else if client-core exits, we get woken up here, and retry with a timeout |
| 265 | * |
| 266 | * Post when this call returns to the caller, the specified op will no |
| 267 | * longer be on any list or htable. |
| 268 | * |
| 269 | * Returns 0 on success and -errno on failure |
| 270 | * Errors are: |
| 271 | * EAGAIN in case we want the caller to requeue and try again.. |
| 272 | * EINTR/EIO/ETIMEDOUT indicating we are done trying to service this |
| 273 | * operation since client-core seems to be exiting too often |
| 274 | * or if we were interrupted. |
Al Viro | d2d87a3 | 2016-02-13 10:15:22 -0500 | [diff] [blame] | 275 | * |
| 276 | * Returns with op->lock taken. |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 277 | */ |
Al Viro | c72f15b | 2016-02-13 10:49:24 -0500 | [diff] [blame] | 278 | static int wait_for_matching_downcall(struct orangefs_kernel_op_s *op, |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 279 | long timeout, |
Al Viro | c72f15b | 2016-02-13 10:49:24 -0500 | [diff] [blame] | 280 | bool interruptible) |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 281 | { |
Al Viro | 05b39a8 | 2016-02-13 11:04:19 -0500 | [diff] [blame] | 282 | long n; |
Al Viro | c72f15b | 2016-02-13 10:49:24 -0500 | [diff] [blame] | 283 | |
| 284 | if (interruptible) |
Mike Marshall | adcf34a | 2016-02-24 16:54:27 -0500 | [diff] [blame^] | 285 | n = wait_for_completion_interruptible_timeout(&op->waitq, |
| 286 | timeout); |
Al Viro | c72f15b | 2016-02-13 10:49:24 -0500 | [diff] [blame] | 287 | else |
| 288 | n = wait_for_completion_killable_timeout(&op->waitq, timeout); |
| 289 | |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 290 | spin_lock(&op->lock); |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 291 | |
Al Viro | d2d87a3 | 2016-02-13 10:15:22 -0500 | [diff] [blame] | 292 | if (op_state_serviced(op)) |
| 293 | return 0; |
| 294 | |
| 295 | if (unlikely(n < 0)) { |
| 296 | gossip_debug(GOSSIP_WAIT_DEBUG, |
| 297 | "*** %s:" |
| 298 | " operation interrupted by a signal (tag " |
| 299 | "%llu, op %p)\n", |
| 300 | __func__, |
| 301 | llu(op->tag), |
| 302 | op); |
| 303 | return -EINTR; |
| 304 | } |
Al Viro | d2d87a3 | 2016-02-13 10:15:22 -0500 | [diff] [blame] | 305 | if (op_state_purged(op)) { |
| 306 | gossip_debug(GOSSIP_WAIT_DEBUG, |
| 307 | "*** %s:" |
| 308 | " operation purged (tag " |
| 309 | "%llu, %p, att %d)\n", |
| 310 | __func__, |
| 311 | llu(op->tag), |
| 312 | op, |
| 313 | op->attempts); |
| 314 | return (op->attempts < ORANGEFS_PURGE_RETRY_COUNT) ? |
| 315 | -EAGAIN : |
| 316 | -EIO; |
| 317 | } |
| 318 | /* must have timed out, then... */ |
| 319 | gossip_debug(GOSSIP_WAIT_DEBUG, |
| 320 | "*** %s:" |
| 321 | " operation timed out (tag" |
| 322 | " %llu, %p, att %d)\n", |
| 323 | __func__, |
| 324 | llu(op->tag), |
| 325 | op, |
| 326 | op->attempts); |
| 327 | return -ETIMEDOUT; |
Mike Marshall | 1182fca | 2015-07-17 10:38:15 -0400 | [diff] [blame] | 328 | } |