From: Colin Ian King <[email protected]>

static analysis shows that calling gossip_debug on op is problematic
because op freed by the previous call to set_op_state_purged. Fix
this by printing the debug before freeing op.

Signed-off-by: Colin Ian King <[email protected]>
---
 fs/orangefs/orangefs-mod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/orangefs/orangefs-mod.c b/fs/orangefs/orangefs-mod.c
index 6f072a8..95a3730 100644
--- a/fs/orangefs/orangefs-mod.c
+++ b/fs/orangefs/orangefs-mod.c
@@ -277,13 +277,13 @@ void purge_inprogress_ops(void)
                                         next,
                                         &htable_ops_in_progress[i],
                                         list) {
-                       set_op_state_purged(op);
                        gossip_debug(GOSSIP_DEV_DEBUG,
                                     "%s: op:%s: op_state:%d: process:%s:\n",
                                     __func__,
                                     get_opname_string(op),
                                     op->op_state,
                                     current->comm);
+                       set_op_state_purged(op);
                }
                spin_unlock(&htable_ops_in_progress_lock);
        }
-- 
2.7.4

Reply via email to