From 05a50a5be897004b6c1399645256bcf2e768b4ef Mon Sep 17 00:00:00 2001 From: Al Viro Date: Thu, 18 Feb 2016 18:59:44 -0500 Subject: orangefs: have ..._clean_interrupted_...() wait for copy to/from daemon * turn all those list_del(&op->list) into list_del_init() * don't pick ops that are already given up in control device ->read()/->write_iter(). * have orangefs_clean_interrupted_operation() notice if op is currently being copied to/from daemon (by said ->read()/->write_iter()) and wait for that to finish. * when we are done copying to/from daemon and find that it had been given up while we were doing that, wake the waiting ..._clean_interrupted_... As the result, we are guaranteed that orangefs_clean_interrupted_operation(op) doesn't return until nobody else can see op. Moreover, we don't need to play with op refcounts anymore. Signed-off-by: Al Viro Signed-off-by: Mike Marshall --- fs/orangefs/orangefs-kernel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/orangefs/orangefs-kernel.h') diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h index 1d20eadaefd8..7d0c8b3afc7e 100644 --- a/fs/orangefs/orangefs-kernel.h +++ b/fs/orangefs/orangefs-kernel.h @@ -259,7 +259,7 @@ static inline void set_op_state_purged(struct orangefs_kernel_op_s *op) { spin_lock(&op->lock); if (unlikely(op_is_cancel(op))) { - list_del(&op->list); + list_del_init(&op->list); spin_unlock(&op->lock); put_cancel(op); } else { -- cgit v1.2.3