···590590 * remount all mounted orangefs volumes to regain the lost591591 * dynamic mount tables (if any) -- NOTE: this is done592592 * without keeping the superblock list locked due to the593593- * upcall/downcall waiting. also, the request semaphore is593593+ * upcall/downcall waiting. also, the request mutex is594594 * used to ensure that no operations will be serviced until595595 * all of the remounts are serviced (to avoid ops between596596 * mounts to fail)
+1-1
fs/orangefs/orangefs-kernel.h
···603603#define ORANGEFS_OP_INTERRUPTIBLE 1 /* service_operation() is interruptible */604604#define ORANGEFS_OP_PRIORITY 2 /* service_operation() is high priority */605605#define ORANGEFS_OP_CANCELLATION 4 /* this is a cancellation */606606-#define ORANGEFS_OP_NO_SEMAPHORE 8 /* don't acquire semaphore */606606+#define ORANGEFS_OP_NO_MUTEX 8 /* don't acquire request_mutex */607607#define ORANGEFS_OP_ASYNC 16 /* Queue it, but don't wait */608608609609int service_operation(struct orangefs_kernel_op_s *op,
+2-2
fs/orangefs/super.c
···229229 new_op->upcall.req.fs_mount.orangefs_config_server);230230231231 /*232232- * we assume that the calling function has already acquire the232232+ * we assume that the calling function has already acquired the233233 * request_mutex to prevent other operations from bypassing234234 * this one235235 */236236 ret = service_operation(new_op, "orangefs_remount",237237- ORANGEFS_OP_PRIORITY | ORANGEFS_OP_NO_SEMAPHORE);237237+ ORANGEFS_OP_PRIORITY | ORANGEFS_OP_NO_MUTEX);238238 gossip_debug(GOSSIP_SUPER_DEBUG,239239 "orangefs_remount: mount got return value of %d\n",240240 ret);
+25-10
fs/orangefs/waitqueue.c
···5656 int flags)5757{5858 long timeout = MAX_SCHEDULE_TIMEOUT;5959- /* flags to modify behavior */6059 int ret = 0;61606261 DEFINE_WAIT(wait_entry);···7374 current->comm,7475 current->pid);75767676- if (!(flags & ORANGEFS_OP_NO_SEMAPHORE)) {7777+ /*7878+ * If ORANGEFS_OP_NO_MUTEX was set in flags, we need to avoid7979+ * aquiring the request_mutex because we're servicing a8080+ * high priority remount operation and the request_mutex is8181+ * already taken.8282+ */8383+ if (!(flags & ORANGEFS_OP_NO_MUTEX)) {7784 if (flags & ORANGEFS_OP_INTERRUPTIBLE)7885 ret = mutex_lock_interruptible(&request_mutex);7986 else8087 ret = mutex_lock_killable(&request_mutex);8188 /*8289 * check to see if we were interrupted while waiting for8383- * semaphore9090+ * mutex8491 */8592 if (ret < 0) {8693 op->downcall.status = ret;···10095 spin_lock(&orangefs_request_list_lock);10196 spin_lock(&op->lock);10297 set_op_state_waiting(op);9898+ /* add high priority remount op to the front of the line. */10399 if (flags & ORANGEFS_OP_PRIORITY)104100 list_add(&op->list, &orangefs_request_list);105101 else···115109 }116110 spin_unlock(&orangefs_request_list_lock);117111118118- if (!(flags & ORANGEFS_OP_NO_SEMAPHORE))112112+ if (!(flags & ORANGEFS_OP_NO_MUTEX))119113 mutex_unlock(&request_mutex);120114121115 ret = wait_for_matching_downcall(op, timeout,···138132139133 /* failed to get matching downcall */140134 if (ret == -ETIMEDOUT) {141141- gossip_err("orangefs: %s -- wait timed out; aborting attempt.\n",135135+ gossip_err("%s: %s -- wait timed out; aborting attempt.\n",136136+ __func__,142137 op_name);143138 }139139+140140+ /*141141+ * remove waiting ops from the request list or142142+ * remove in-progress ops from the in-progress list.143143+ */144144 orangefs_clean_up_interrupted_operation(op);145145+145146 op->downcall.status = ret;146147 /* retry if operation has not been serviced and if requested */147148 if (ret == -EAGAIN) {···161148 op_name,162149 op->attempts);163150151151+ /*152152+ * io ops (ops that use the shared memory buffer) have153153+ * to be returned to their caller for a retry. Other ops154154+ * can just be recycled here.155155+ */164156 if (!op->uses_shared_memory)165165- /*166166- * this operation doesn't use the shared memory167167- * system168168- */169157 goto retry_servicing;170158 }171159···282268 long n;283269284270 if (interruptible)285285- n = wait_for_completion_interruptible_timeout(&op->waitq, timeout);271271+ n = wait_for_completion_interruptible_timeout(&op->waitq,272272+ timeout);286273 else287274 n = wait_for_completion_killable_timeout(&op->waitq, timeout);288275