Skip to contentSkip to conversation

ocfs2: update seq_file index in ocfs2_dlm_seq_next V2

PATCH Applied Wengang Wang 2 participants 2 messages Nov 19, 2024 – Nov 20, 2024 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2: update seq_file index in ocfs2_dlm_seq_next V2

The following INFO level message was seen:

seq_file: buggy .next function ocfs2_dlm_seq_next [ocfs2] did not update position index

Fix:
Update *pos (so m->index) to make seq_read_iter happy though the index its self makes no sense to ocfs2_dlm_seq_next.

---
 fs/ocfs2/dlmglue.c | 1 +
 1 file changed, 1 insertion(+)
fs/ocfs2/dlmglue.c +1 -0
index 60df52e4c1f8..764ecbd5ad41 100644
@@ -3110,6 +3110,7 @@ static void *ocfs2_dlm_seq_next(struct seq_file *m, void *v, loff_t *pos)
 	struct ocfs2_lock_res *iter = v;
 	struct ocfs2_lock_res *dummy = &priv->p_iter_res;
 
+	(*pos)++;
 	spin_lock(&ocfs2_dlm_tracking_lock);
 	iter = ocfs2_dlm_next_res(iter, priv);
 	list_del_init(&dummy->l_debug_list);
Signature · 1 line
2.39.5 (Apple Git-154)
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Wengang Wang

The following INFO level message was seen:

seq_file: buggy .next function ocfs2_dlm_seq_next [ocfs2] did not update position index

Fix:
Update *pos (so m->index) to make seq_read_iter happy though the index its self makes no sense to ocfs2_dlm_seq_next.

Quoted 16 lines
---
 fs/ocfs2/dlmglue.c | 1 +
 1 file changed, 1 insertion(+)
fs/ocfs2/dlmglue.c +1 -0
index 60df52e4c1f8..764ecbd5ad41 100644
@@ -3110,6 +3110,7 @@ static void *ocfs2_dlm_seq_next(struct seq_file *m, void *v, loff_t *pos)
 	struct ocfs2_lock_res *iter = v;
 	struct ocfs2_lock_res *dummy = &priv->p_iter_res;
 
+	(*pos)++;
 	spin_lock(&ocfs2_dlm_tracking_lock);
 	iter = ocfs2_dlm_next_res(iter, priv);
 	list_del_init(&dummy->l_debug_list);