@@ -75,7 +75,7 @@ int service_operation(struct orangefs_kernel_op_s *op,
7575
7676 /*
7777 * If ORANGEFS_OP_NO_MUTEX was set in flags, we need to avoid
78- * aquiring the request_mutex because we're servicing a
78+ * acquiring the request_mutex because we're servicing a
7979 * high priority remount operation and the request_mutex is
8080 * already taken.
8181 */
@@ -91,7 +91,8 @@ int service_operation(struct orangefs_kernel_op_s *op,
9191 if (ret < 0 ) {
9292 op -> downcall .status = ret ;
9393 gossip_debug (GOSSIP_WAIT_DEBUG ,
94- "orangefs: service_operation interrupted.\n" );
94+ "%s: service_operation interrupted.\n" ,
95+ __func__ );
9596 return ret ;
9697 }
9798 }
@@ -127,9 +128,9 @@ int service_operation(struct orangefs_kernel_op_s *op,
127128 ret ,
128129 op );
129130
131+ /* got matching downcall; make sure status is in errno format */
130132 if (!ret ) {
131133 spin_unlock (& op -> lock );
132- /* got matching downcall; make sure status is in errno format */
133134 op -> downcall .status =
134135 orangefs_normalize_to_errno (op -> downcall .status );
135136 ret = op -> downcall .status ;
@@ -144,8 +145,8 @@ int service_operation(struct orangefs_kernel_op_s *op,
144145 }
145146
146147 /*
147- * remove waiting ops from the request list or
148- * remove in-progress ops from the in-progress list.
148+ * remove a waiting op from the request list or
149+ * remove an in-progress op from the in-progress list.
149150 */
150151 orangefs_clean_up_interrupted_operation (op );
151152
@@ -179,6 +180,7 @@ int service_operation(struct orangefs_kernel_op_s *op,
179180 return ret ;
180181}
181182
183+ /* This can get called on an I/O op if it had a bad service_operation. */
182184bool orangefs_cancel_op_in_progress (struct orangefs_kernel_op_s * op )
183185{
184186 u64 tag = op -> tag ;
@@ -206,23 +208,31 @@ bool orangefs_cancel_op_in_progress(struct orangefs_kernel_op_s *op)
206208 spin_unlock (& op -> lock );
207209 spin_unlock (& orangefs_request_list_lock );
208210
209- gossip_debug (GOSSIP_UTILS_DEBUG ,
211+ gossip_debug (GOSSIP_WAIT_DEBUG ,
210212 "Attempting ORANGEFS operation cancellation of tag %llu\n" ,
211213 llu (tag ));
212214 return true;
213215}
214216
215- static void orangefs_clean_up_interrupted_operation (struct orangefs_kernel_op_s * op )
217+ /*
218+ * Change an op to the "given up" state and remove it from its list.
219+ */
220+ static void
221+ orangefs_clean_up_interrupted_operation (struct orangefs_kernel_op_s * op )
216222{
217223 /*
218224 * 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.
225+ * the interruption is detected.
221226 *
222227 * Called with op->lock held.
223228 */
229+
230+ /*
231+ * List manipulation code elsewhere will ignore ops that
232+ * have been given up upon.
233+ */
224234 op -> op_state |= OP_VFS_STATE_GIVEN_UP ;
225- /* from that point on it can't be moved by anybody else */
235+
226236 if (list_empty (& op -> list )) {
227237 /* caught copying to/from daemon */
228238 BUG_ON (op_state_serviced (op ));
@@ -259,12 +269,12 @@ static void orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s
259269}
260270
261271/*
262- * sleeps on waitqueue waiting for matching downcall.
263- * if client-core finishes servicing, then we are good to go.
272+ * Sleeps on waitqueue waiting for matching downcall.
273+ * If client-core finishes servicing, then we are good to go.
264274 * else if client-core exits, we get woken up here, and retry with a timeout
265275 *
266- * Post when this call returns to the caller, the specified op will no
267- * longer be on any list or htable .
276+ * When this call returns to the caller, the specified op will no
277+ * longer be in either the in_progress hash table or on the request list .
268278 *
269279 * Returns 0 on success and -errno on failure
270280 * Errors are:
@@ -281,6 +291,12 @@ static int wait_for_matching_downcall(struct orangefs_kernel_op_s *op,
281291{
282292 long n ;
283293
294+ /*
295+ * There's a "schedule_timeout" inside of these wait
296+ * primitives, during which the op is out of the hands of the
297+ * user process that needs something done and is being
298+ * manipulated by the client-core process.
299+ */
284300 if (interruptible )
285301 n = wait_for_completion_interruptible_timeout (& op -> waitq ,
286302 timeout );
0 commit comments