Re: [PATCH 46/48] truncate,shmem: Handle truncates that split large folios
From: Matthew Wilcox <willy@infradead.org>
Date: 2021-12-08 16:43:08
Also in:
linux-fsdevel
On Wed, Dec 08, 2021 at 04:22:54AM +0000, Matthew Wilcox (Oracle) wrote:
quoted hunk ↗ jump to hunk
@@ -917,13 +904,13 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend, struct shmem_inode_info *info = SHMEM_I(inode); pgoff_t start = (lstart + PAGE_SIZE - 1) >> PAGE_SHIFT; pgoff_t end = (lend + 1) >> PAGE_SHIFT; - unsigned int partial_start = lstart & (PAGE_SIZE - 1); - unsigned int partial_end = (lend + 1) & (PAGE_SIZE - 1); struct folio_batch fbatch; pgoff_t indices[PAGEVEC_SIZE]; + struct folio *folio;
This turns a couple of other definitions of struct folio in this function into shadowed definitions. We don't have -Wshadow turned on, so I didn't notice until doing more patch review this morning. I'm going to fold in this patch:
+++ b/mm/shmem.c@@ -919,7 +919,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend, while (index < end && find_lock_entries(mapping, index, end - 1, &fbatch, indices)) { for (i = 0; i < folio_batch_count(&fbatch); i++) { - struct folio *folio = fbatch.folios[i]; + folio = fbatch.folios[i]; index = indices[i];
@@ -985,7 +985,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend, continue; } for (i = 0; i < folio_batch_count(&fbatch); i++) { - struct folio *folio = fbatch.folios[i]; + folio = fbatch.folios[i]; index = indices[i]; if (xa_is_value(folio)) {