Skip to contentSkip to conversation

nfs: drop the incorrect assertion in nfs_swap_rw()

PATCH Applied Barry Song 4 participants 5 messages Jun 18, 2024 – Jun 20, 2024

Subsystems (6)
lore
Share & tools
lore

Barry Song

author
#0 lore raw

PATCH v2 1/1 nfs: drop the incorrect assertion in nfs_swap_rw()

From: Christoph Hellwig <[email protected]>

Since commit 2282679fb20b ("mm: submit multipage write for SWP_FS_OPS swap-space"), we can plug multiple pages then unplug them all together. That means iov_iter_count(iter) could be way bigger than PAGE_SIZE, it actually equals the size of iov_iter_npages(iter, INT_MAX).

Note this issue has nothing to do with large folios as we don't support THP_SWPOUT to non-block devices.

Fixes 2282679fb20b ("mm: submit multipage write for SWP_FS_OPS swap-space")
Cc NeilBrown <[email protected]>
Cc Anna Schumaker <[email protected]>
Cc Steve French <[email protected]>
Cc Trond Myklebust <[email protected]>
Cc Chuanhua Han <[email protected]>
Cc Ryan Roberts <[email protected]>
Cc Chris Li <[email protected]>
Cc "Huang, Ying" <[email protected]>
Cc Jeff Layton <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Martin Wege <[email protected]>
[Barry: figure out the cause and correct the commit message]
---
 fs/nfs/direct.c | 2 --
 1 file changed, 2 deletions(-)
fs/nfs/direct.c +0 -2
index bb2f583eb28b..90079ca134dd 100644
@@ -141,8 +141,6 @@ int nfs_swap_rw(struct kiocb *iocb, struct iov_iter *iter)
 {
 	ssize_t ret;
 
-	VM_BUG_ON(iov_iter_count(iter) != PAGE_SIZE);
-
 	if (iov_iter_rw(iter) == READ)
 		ret = nfs_file_direct_read(iocb, iter, true);
 	else
Signature · 1 line
2.34.1
Reviewed-by on v2 1/1
#1 lore raw

fs/nfs/direct.c

Quoted 37 lines · Barry Song

From: Christoph Hellwig <[email protected]>

Since commit 2282679fb20b ("mm: submit multipage write for SWP_FS_OPS swap-space"), we can plug multiple pages then unplug them all together. That means iov_iter_count(iter) could be way bigger than PAGE_SIZE, it actually equals the size of iov_iter_npages(iter, INT_MAX).

Note this issue has nothing to do with large folios as we don't support THP_SWPOUT to non-block devices.

Fixes 2282679fb20b ("mm: submit multipage write for SWP_FS_OPS swap-space")
Cc NeilBrown <[email protected]>
Cc Anna Schumaker <[email protected]>
Cc Steve French <[email protected]>
Cc Trond Myklebust <[email protected]>
Cc Chuanhua Han <[email protected]>
Cc Ryan Roberts <[email protected]>
Cc Chris Li <[email protected]>
Cc "Huang, Ying" <[email protected]>
Cc Jeff Layton <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Martin Wege <[email protected]>
[Barry: figure out the cause and correct the commit message]
---
 fs/nfs/direct.c | 2 --
 1 file changed, 2 deletions(-)
fs/nfs/direct.c +0 -0
index bb2f583eb28b..90079ca134dd 100644

Please add a

Thanks,
Martin

author
#3 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 4 lines · Barry Song
Fixes 2282679fb20b ("mm: submit multipage write for SWP_FS_OPS swap-space")

A reported-by for the credited patch author doesn't make sense.

Andrew, could you help remove the "reported-by" in the commit log? Alternatively, would you prefer that I send a v3 to drop the "reported-by"?

Quoted 1 line
maintainer
#4 lore raw
Quoted 6 lines · On Wed, 19 Jun 2024 17:34:27 +1200 Barry Song <[email protected]> wrote:
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Barry Song
Fixes 2282679fb20b ("mm: submit multipage write for SWP_FS_OPS swap-space")
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

A reported-by for the credited patch author doesn't make sense.

Andrew, could you help remove the "reported-by" in the commit log? Alternatively, would you prefer that I send a v3 to drop the "reported-by"?

I made that edit.