Re: [PATCH v7 14/22] mm: memfd_luo: allow preserving memfd
From: Pasha Tatashin <pasha.tatashin@soleen.com>
Date: 2025-11-24 03:14:17
Also in:
linux-doc, linux-fsdevel, linux-mm, lkml
From: Pasha Tatashin <pasha.tatashin@soleen.com>
Date: 2025-11-24 03:14:17
Also in:
linux-doc, linux-fsdevel, linux-mm, lkml
quoted
+unlock_folio: + folio_unlock(folio); + folio_put(folio); + i++;I'd add a counter and use it int the below for loop.
Done.
quoted
+put_folios: + /* + * Note: don't free the folios already added to the file. They will be + * freed when the file is freed. Free the ones not added yet here. + */ + for (; i < nr_folios; i++) { + const struct memfd_luo_folio_ser *pfolio = &folios_ser[i]; + + folio = kho_restore_folio(pfolio->pfn); + if (folio) + folio_put(folio); + } + + return err; +}Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Thanks! Pasha
-- Sincerely yours, Mike.