fs/netfs/read_collect: add to next->prev_donated
Subsystems (2)
PATCH RESEND 1/1 fs/netfs/read_collect: add to next->prev_donated
If multiple subrequests donate data to the same "next" request (depending on the subrequest completion order), each of them would overwrite the prev_donated field, causing data corruption and a BUG() crash ("Can't donate prior to front").
--- fs/netfs/read_collect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/netfs/read_collect.c +1 -1
@@ -284,7 +284,7 @@ static bool netfs_consume_read_data(struct netfs_io_subrequest *subreq, bool was netfs_trace_donate_to_deferred_next); }else { next =list_next_entry (subreq, rreq_link); -WRITE_ONCE (next->prev_donated, excess); +WRITE_ONCE (next->prev_donated, next->prev_donated + excess);trace_netfs_donate (rreq, subreq, next, excess, netfs_trace_donate_to_next); }
Signature · 1 line
2.47.2
Hi,
Quoted 29 lines · Max Kellermann
If multiple subrequests donate data to the same "next" request (depending on the subrequest completion order), each of them would overwrite the
prev_donatedfield, causing data corruption and aBUG()crash ("Can't donate prior to front").Fixes ee4cdf7ba857 ("netfs: Speed up buffered reading")Closes https://lore.kernel.org/netfs/CAKPOu+_4mUwYgQtRTbXCmi+-k3PGvLysnPadkmHOyB7Gz0iSMA@mail.gmail.com/ open hereSigned-off-by Max Kellermann <[email protected]>Signed-off-by David Howells <[email protected]>--- fs/netfs/read_collect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/netfs/read_collect.c +1
-1@@ -284,7 +284,7 @@ static bool netfs_consume_read_data(struct netfs_io_subrequest *subreq, bool was netfs_trace_donate_to_deferred_next); }else { next =list_next_entry (subreq, rreq_link); -WRITE_ONCE (next->prev_donated, excess); +WRITE_ONCE (next->prev_donated, next->prev_donated + excess);trace_netfs_donate (rreq, subreq, next, excess, netfs_trace_donate_to_next); }Signature · 1 line
2.47.2
Unless I did some mistakes researching both the stable, netfs lists, did this felt through the cracks and is still missing for to be picked for the 6.12.y and 6.13.y series?
Regards,
Salvatore
David Howells
maintainerHi Greg,
Could you pick this up for 6.12.y and 6.13.y?
https://lore.kernel.org/netfs/[email protected]/
Thanks,
David
Greg Kroah-Hartman
maintainerQuoted 5 lines · David Howells
Hi Greg,
Could you pick this up for 6.12.y and 6.13.y?
Oops, missed this, sorry, now queued up.
greg k-h
Patch "fs/netfs/read_collect: add to next->prev_donated" has been added to the 6.12-stable tree
In reply to Max KellermannThis is a note to let you know that I've just added the patch titled
fs/netfs/read_collect: add to next->prev_donated
to the 6.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
fs-netfs-read_collect-add-to-next-prev_donated.patch
and it can be found in the queue-6.12 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From [email protected] Thu Feb 20 07:27:34 2025
From: Max Kellermann <[email protected]>
Date: Thu, 20 Feb 2025 16:24:50 +0100
Subject: fs/netfs/read_collect: add to next->prev_donated
To: [email protected], [email protected], [email protected]
Cc: Max Kellermann <[email protected]>, [email protected]
Message-ID: <[email protected]>
From: Max Kellermann <[email protected]>
If multiple subrequests donate data to the same "next" request (depending on the subrequest completion order), each of them would overwrite the prev_donated field, causing data corruption and a BUG() crash ("Can't donate prior to front").
--- fs/netfs/read_collect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/netfs/read_collect.c +1 -1
@@ -284,7 +284,7 @@ static bool netfs_consume_read_data(struct netfs_io_subrequest *subreq, bool was netfs_trace_donate_to_deferred_next); }else { next =list_next_entry (subreq, rreq_link); -WRITE_ONCE (next->prev_donated, excess); +WRITE_ONCE (next->prev_donated, next->prev_donated + excess);trace_netfs_donate (rreq, subreq, next, excess, netfs_trace_donate_to_next); }
Signature · 7 lines
2.47.2 Patches currently in stable-queue which might be from [email protected] are queue-6.12/fs-netfs-read_collect-add-to-next-prev_donated.patch
Patch "fs/netfs/read_collect: add to next->prev_donated" has been added to the 6.13-stable tree
In reply to Max KellermannThis is a note to let you know that I've just added the patch titled
fs/netfs/read_collect: add to next->prev_donated
to the 6.13-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
fs-netfs-read_collect-add-to-next-prev_donated.patch
and it can be found in the queue-6.13 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From [email protected] Thu Feb 20 07:27:34 2025
From: Max Kellermann <[email protected]>
Date: Thu, 20 Feb 2025 16:24:50 +0100
Subject: fs/netfs/read_collect: add to next->prev_donated
To: [email protected], [email protected], [email protected]
Cc: Max Kellermann <[email protected]>, [email protected]
Message-ID: <[email protected]>
From: Max Kellermann <[email protected]>
If multiple subrequests donate data to the same "next" request (depending on the subrequest completion order), each of them would overwrite the prev_donated field, causing data corruption and a BUG() crash ("Can't donate prior to front").
--- fs/netfs/read_collect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/netfs/read_collect.c +1 -1
@@ -284,7 +284,7 @@ donation_changed: netfs_trace_donate_to_deferred_next); }else { next =list_next_entry (subreq, rreq_link); -WRITE_ONCE (next->prev_donated, excess); +WRITE_ONCE (next->prev_donated, next->prev_donated + excess);trace_netfs_donate (rreq, subreq, next, excess, netfs_trace_donate_to_next); }
Patches currently in stable-queue which might be from [email protected] are
queue-6.13/fs-netfs-read_collect-add-to-next-prev_donated.patch