Skip to content

Commit

Permalink
netfs: fix parameter of cleanup()
Browse files Browse the repository at this point in the history
commit 3cfef1b upstream.

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.

Cc: stable@vger.kernel.org
Fixes: 3d3c950 ("netfs: Provide readahead and readpage netfs helpers")
Fixes: e1b1240 ("netfs: Add write_begin helper")
Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Link: https://lore.kernel.org/r/20211207031449.100510-1-jefflexu@linux.alibaba.com/ # v1
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
lostjeffle authored and gregkh committed Dec 29, 2021
1 parent a8a9d75 commit 35f9ff4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/netfs/read_helper.c
Expand Up @@ -958,7 +958,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, page_file_mapping(page));
ops->cleanup(page_file_mapping(page), netfs_priv);
unlock_page(page);
return -ENOMEM;
}
Expand Down Expand Up @@ -1185,7 +1185,7 @@ int netfs_write_begin(struct file *file, struct address_space *mapping,
goto error;
have_page_no_wait:
if (netfs_priv)
ops->cleanup(netfs_priv, mapping);
ops->cleanup(mapping, netfs_priv);
*_page = page;
_leave(" = 0");
return 0;
Expand All @@ -1196,7 +1196,7 @@ int netfs_write_begin(struct file *file, struct address_space *mapping,
unlock_page(page);
put_page(page);
if (netfs_priv)
ops->cleanup(netfs_priv, mapping);
ops->cleanup(mapping, netfs_priv);
_leave(" = %d", ret);
return ret;
}
Expand Down

0 comments on commit 35f9ff4

Please sign in to comment.