Skip to contentSkip to conversation

netfs: do not get the folio reference twice

RFC PATCH In review [email protected] 1 participant 2 messages Jul 5, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 netfs: do not get the folio reference twice

From: Xiubo Li <[email protected]>

And also the comment said it will drop the folio references but the code was increasing it.

---
 fs/netfs/buffered_read.c | 3 ---
 1 file changed, 3 deletions(-)
fs/netfs/buffered_read.c +0 -3
index 5b93e22397fe..a44a5b3b8d4c 100644
@@ -396,9 +396,6 @@ int netfs_write_begin(struct netfs_inode *ctx,
 	 */
 	ractl._nr_pages = folio_nr_pages(folio);
 	netfs_rreq_expand(rreq, &ractl);
-
-	/* We hold the folio locks, so we can drop the references */
-	folio_get(folio);
 	while (readahead_folio(&ractl))
 		;
 
Signature · 1 line
2.36.0.rc1
author
#1 lore raw
Quoted 15 lines · On 7/5/22 10:22 AM, [email protected] wrote:

From: Xiubo Li <[email protected]>

And also the comment said it will drop the folio references but the code was increasing it.

---
  fs/netfs/buffered_read.c | 3 ---
  1 file changed, 3 deletions(-)
fs/netfs/buffered_read.c +0 -0
index 5b93e22397fe..a44a5b3b8d4c 100644

fs/netfs/buffered_read.c int netfs_write_begin(struct netfs_inode *ctx, · line 401

Quoted 9 lines
fs/netfs/buffered_read.c +0 -3
@@ -396,9 +396,6 @@ int netfs_write_begin(struct netfs_inode *ctx,
  	 */
  	ractl._nr_pages = folio_nr_pages(folio);
  	netfs_rreq_expand(rreq, &ractl);
-
-	/* We hold the folio locks, so we can drop the references */
-	folio_get(folio);
  	while (readahead_folio(&ractl))
  		;
 

Will drop this patch, the above fix it incorrect.

Thanks!