orangefs: use list_for_each_entry_safe in purge_waiting_ops
authorMartin Brandenburg <martin@omnibond.com>
Mon, 22 Jan 2018 20:44:51 +0000 (15:44 -0500)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 22 Jan 2018 21:51:14 +0000 (13:51 -0800)
set_op_state_purged can delete the op.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/orangefs/waitqueue.c

index 835c6e148afccbb75105d221f8d3034159b20b52..0577d6dba8c81dc531f9ed027258f077c8a96ace 100644 (file)
@@ -29,10 +29,10 @@ static void orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s
  */
 void purge_waiting_ops(void)
 {
-       struct orangefs_kernel_op_s *op;
+       struct orangefs_kernel_op_s *op, *tmp;
 
        spin_lock(&orangefs_request_list_lock);
-       list_for_each_entry(op, &orangefs_request_list, list) {
+       list_for_each_entry_safe(op, tmp, &orangefs_request_list, list) {
                gossip_debug(GOSSIP_WAIT_DEBUG,
                             "pvfs2-client-core: purging op tag %llu %s\n",
                             llu(op->tag),