* FAILED: patch "[PATCH] netfs: fix parameter of cleanup()" failed to apply to 5.15-stable tree
@ 2021-12-10 11:07 gregkh
2021-12-10 15:36 ` David Howells
2021-12-24 3:52 ` [PATCH for 5.15.y stable] netfs: fix parameter of cleanup() Jeffle Xu
0 siblings, 2 replies; 6+ messages in thread
From: gregkh @ 2021-12-10 11:07 UTC (permalink / raw)
To: jefflexu, dhowells, jlayton; +Cc: stable
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3cfef1b612e15a0c2f5b1c9d3f3f31ad72d56fcd Mon Sep 17 00:00:00 2001
From: Jeffle Xu <jefflexu@linux.alibaba.com>
Date: Tue, 7 Dec 2021 11:14:49 +0800
Subject: [PATCH] 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.
Cc: stable@vger.kernel.org
Fixes: 3d3c95046742 ("netfs: Provide readahead and readpage netfs helpers")
Fixes: e1b1240c1ff5 ("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
diff --git a/fs/netfs/read_helper.c b/fs/netfs/read_helper.c
index 7c6e199618af..75c76cbb27cc 100644
--- a/fs/netfs/read_helper.c
+++ b/fs/netfs/read_helper.c
@@ -955,7 +955,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;
}
@@ -1186,7 +1186,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;
@@ -1197,7 +1197,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;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: FAILED: patch "[PATCH] netfs: fix parameter of cleanup()" failed to apply to 5.15-stable tree
2021-12-10 11:07 FAILED: patch "[PATCH] netfs: fix parameter of cleanup()" failed to apply to 5.15-stable tree gregkh
@ 2021-12-10 15:36 ` David Howells
2021-12-22 12:13 ` Greg KH
2021-12-24 3:52 ` [PATCH for 5.15.y stable] netfs: fix parameter of cleanup() Jeffle Xu
1 sibling, 1 reply; 6+ messages in thread
From: David Howells @ 2021-12-10 15:36 UTC (permalink / raw)
To: gregkh; +Cc: dhowells, jefflexu, jlayton, stable
<gregkh@linuxfoundation.org> wrote:
> - ops->cleanup(netfs_priv, folio_file_mapping(folio));
> + ops->cleanup(folio_file_mapping(folio), netfs_priv);
Is it page->mapping or page_mapping(page) instead of folio_file_mapping()? If
so, you can switch that to the other side instead, e.g.:
- ops->cleanup(netfs_priv, page_mapping(page));
+ ops->cleanup(page_mapping(page), netfs_priv);
David
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: FAILED: patch "[PATCH] netfs: fix parameter of cleanup()" failed to apply to 5.15-stable tree
2021-12-10 15:36 ` David Howells
@ 2021-12-22 12:13 ` Greg KH
2021-12-22 12:16 ` JeffleXu
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2021-12-22 12:13 UTC (permalink / raw)
To: David Howells; +Cc: jefflexu, jlayton, stable
On Fri, Dec 10, 2021 at 03:36:15PM +0000, David Howells wrote:
> <gregkh@linuxfoundation.org> wrote:
>
> > - ops->cleanup(netfs_priv, folio_file_mapping(folio));
> > + ops->cleanup(folio_file_mapping(folio), netfs_priv);
>
> Is it page->mapping or page_mapping(page) instead of folio_file_mapping()? If
> so, you can switch that to the other side instead, e.g.:
>
> - ops->cleanup(netfs_priv, page_mapping(page));
> + ops->cleanup(page_mapping(page), netfs_priv);
>
> David
>
Ok, can you or someone send me a fixed up patch like this so that I can
apply it?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: FAILED: patch "[PATCH] netfs: fix parameter of cleanup()" failed to apply to 5.15-stable tree
2021-12-22 12:13 ` Greg KH
@ 2021-12-22 12:16 ` JeffleXu
0 siblings, 0 replies; 6+ messages in thread
From: JeffleXu @ 2021-12-22 12:16 UTC (permalink / raw)
To: Greg KH, David Howells; +Cc: jlayton, stable
On 12/22/21 8:13 PM, Greg KH wrote:
> On Fri, Dec 10, 2021 at 03:36:15PM +0000, David Howells wrote:
>> <gregkh@linuxfoundation.org> wrote:
>>
>>> - ops->cleanup(netfs_priv, folio_file_mapping(folio));
>>> + ops->cleanup(folio_file_mapping(folio), netfs_priv);
>>
>> Is it page->mapping or page_mapping(page) instead of folio_file_mapping()? If
>> so, you can switch that to the other side instead, e.g.:
>>
>> - ops->cleanup(netfs_priv, page_mapping(page));
>> + ops->cleanup(page_mapping(page), netfs_priv);
>>
>> David
>>
>
> Ok, can you or someone send me a fixed up patch like this so that I can
> apply it?
>
OK I will send a new version later. Thanks David for the suggestion.
--
Thanks,
Jeffle
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH for 5.15.y stable] netfs: fix parameter of cleanup()
2021-12-10 11:07 FAILED: patch "[PATCH] netfs: fix parameter of cleanup()" failed to apply to 5.15-stable tree gregkh
2021-12-10 15:36 ` David Howells
@ 2021-12-24 3:52 ` Jeffle Xu
2021-12-27 12:38 ` Greg KH
1 sibling, 1 reply; 6+ messages in thread
From: Jeffle Xu @ 2021-12-24 3:52 UTC (permalink / raw)
To: gregkh, stable; +Cc: dhowells
commit 3cfef1b612e15a0c2f5b1c9d3f3f31ad72d56fcd 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: 3d3c95046742 ("netfs: Provide readahead and readpage netfs helpers")
Fixes: e1b1240c1ff5 ("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
---
fs/netfs/read_helper.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/netfs/read_helper.c b/fs/netfs/read_helper.c
index 4b54529f8176..242f8bcb34a4 100644
--- a/fs/netfs/read_helper.c
+++ b/fs/netfs/read_helper.c
@@ -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;
}
@@ -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;
@@ -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;
}
--
2.27.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH for 5.15.y stable] netfs: fix parameter of cleanup()
2021-12-24 3:52 ` [PATCH for 5.15.y stable] netfs: fix parameter of cleanup() Jeffle Xu
@ 2021-12-27 12:38 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2021-12-27 12:38 UTC (permalink / raw)
To: Jeffle Xu; +Cc: stable, dhowells
On Fri, Dec 24, 2021 at 11:52:43AM +0800, Jeffle Xu wrote:
> commit 3cfef1b612e15a0c2f5b1c9d3f3f31ad72d56fcd 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: 3d3c95046742 ("netfs: Provide readahead and readpage netfs helpers")
> Fixes: e1b1240c1ff5 ("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
> ---
> fs/netfs/read_helper.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Now queued up, thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-12-27 12:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 11:07 FAILED: patch "[PATCH] netfs: fix parameter of cleanup()" failed to apply to 5.15-stable tree gregkh
2021-12-10 15:36 ` David Howells
2021-12-22 12:13 ` Greg KH
2021-12-22 12:16 ` JeffleXu
2021-12-24 3:52 ` [PATCH for 5.15.y stable] netfs: fix parameter of cleanup() Jeffle Xu
2021-12-27 12:38 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.