netfs: fix parameter of cleanup()
Subsystems (2)
PATCH 1/1 netfs: fix parameter of cleanup()
The order of these two parameters is just reversed. gcc didn't warn on that, probably because 'void *' can be converted from or to other pointer types without warning.
Fixes 3d3c95046742 ("netfs: Provide readahead and readpage netfs helpers")
Fixes e1b1240c1ff5 ("netfs: Add write_begin helper")
Signed-off-by Jeffle Xu <[email protected]>
--- fs/netfs/read_helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/netfs/read_helper.c +3 -3
@@ -960,7 +960,7 @@ int netfs_readpage(struct file *file, rreq =netfs_alloc_read_request (ops, netfs_priv, file);if (!rreq) {if (netfs_priv) - ops->cleanup (netfs_priv,folio_file_mapping (folio)); + ops->cleanup (folio_file_mapping (folio), netfs_priv);folio_unlock (folio);return -ENOMEM ; }
@@ -1191,7 +1191,7 @@ int netfs_write_begin(struct file *file, struct address_space *mapping, goto error; have_folio_no_wait:if (netfs_priv) - ops->cleanup (netfs_priv, mapping); + ops->cleanup (mapping, netfs_priv); *_folio = folio;_leave (" = 0" );return 0 ;
@@ -1202,7 +1202,7 @@ int netfs_write_begin(struct file *file, struct address_space *mapping,folio_unlock (folio);folio_put (folio);if (netfs_priv) - ops->cleanup (netfs_priv, mapping); + ops->cleanup (mapping, netfs_priv);_leave (" = %d" , ret);return ret; }
Signature · 1 line
2.27.0
Quoted 35 lines · Jeffle Xu
The order of these two parameters is just reversed. gcc didn't warn on that, probably because 'void *' can be converted from or to other pointer types without warning.
Fixes 3d3c95046742 ("netfs: Provide readahead and readpage netfs helpers")Fixes e1b1240c1ff5 ("netfs: Add write_begin helper")Signed-off-by Jeffle Xu <[email protected]>--- fs/netfs/read_helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)fs/netfs/read_helper.c +2
-2@@ -960,7 +960,7 @@ int netfs_readpage(struct file *file, rreq =netfs_alloc_read_request (ops, netfs_priv, file);if (!rreq) {if (netfs_priv) - ops->cleanup (netfs_priv,folio_file_mapping (folio)); + ops->cleanup (folio_file_mapping (folio), netfs_priv);folio_unlock (folio);return -ENOMEM ; }@@ -1191,7 +1191,7 @@ int netfs_write_begin(struct file *file, struct address_space *mapping, goto error; have_folio_no_wait:if (netfs_priv) - ops->cleanup (netfs_priv, mapping); + ops->cleanup (mapping, netfs_priv); *_folio = folio;_leave (" = 0" );return 0 ;
fs/netfs/read_helper.c int netfs_write_begin(struct file *file, struct address_space *mapping, · line 1208
Quoted 8 lines
fs/netfs/read_helper.c +1
-1@@ -1202,7 +1202,7 @@ int netfs_write_begin(struct file *file, struct address_space *mapping,folio_unlock (folio);folio_put (folio);if (netfs_priv) - ops->cleanup (netfs_priv, mapping); + ops->cleanup (mapping, netfs_priv);_leave (" = %d" , ret);return ret; }
Ouch, good catch.
Reviewed-by Jeff Layton <[email protected]>