netfs: Fix a KMSAN uninit-value error in netfs_clear_buffer

Use folioq_count instead of folioq_nr_slots to fix a KMSAN uninit-value
error in netfs_clear_buffer

Signed-off-by: Chang Yu <marcus.yu.56@gmail.com>
Link: https://lore.kernel.org/r/ZvuXWC2bYpvQsWgS@gmail.com
Fixes: cd0277ed0c ("netfs: Use new folio_queue data type and iterator instead of xarray iter")
Acked-by: David Howells <dhowells@redhat.com>
Reported-by: syzbot+921873345a95f4dae7e9@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=921873345a95f4dae7e9
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Chang Yu 2024-09-30 23:31:52 -07:00 committed by Christian Brauner
parent 0d24852bd7
commit f6023535b5
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2

View File

@ -102,7 +102,7 @@ void netfs_clear_buffer(struct netfs_io_request *rreq)
while ((p = rreq->buffer)) { while ((p = rreq->buffer)) {
rreq->buffer = p->next; rreq->buffer = p->next;
for (int slot = 0; slot < folioq_nr_slots(p); slot++) { for (int slot = 0; slot < folioq_count(p); slot++) {
struct folio *folio = folioq_folio(p, slot); struct folio *folio = folioq_folio(p, slot);
if (!folio) if (!folio)
continue; continue;