mirror of
https://github.com/versity/scoutfs.git
synced 2026-06-01 01:06:21 +00:00
Squelch warning from bpf_iter.c.
v5.7-rc2-1174-gfd4f12bc38c3 significantly rewrites the bpf iterator which hits this _next() function. It also adds a check that verifies that the *pos is incremented after every call, even if it goes beyond the last member (in which case it's not used). Signed-off-by: Auke Kok <auke.kok@versity.com>
This commit is contained in:
@@ -183,6 +183,13 @@ static void *scoutfs_tseq_seq_next(struct seq_file *m, void *v, loff_t *pos)
|
||||
ent = tseq_rb_next(ent);
|
||||
if (ent)
|
||||
*pos = ent->pos;
|
||||
else
|
||||
/*
|
||||
* once we hit the end, *pos is never used, but it has to
|
||||
* be updated to avoid an error in bpf_seq_read()
|
||||
*/
|
||||
(*pos)++;
|
||||
|
||||
return ent;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user