[SRU][jammy PATCH v3 1/1] NFS: nfs_async_write_reschedule_io must not recurse into the writeback code
Magali Lemes
magali.lemes at canonical.com
Mon Dec 16 20:46:17 UTC 2024
Sorry for the delay reviewing this one.
On 16/12/2024 16:40, Mike Snitzer wrote:
> From: Trond Myklebust <trond.myklebust at hammerspace.com>
>
> BugLink: https://bugs.launchpad.net/bugs/2089410
>
> commit 31545f4b7cdb6da6a0519120b8c96dc40f186aac upstream stable/linux-5.15.y.
This should remain exactly as in the original commit you're picking. No
need for changes here, so it should just be `commit
b1a28f2eb9ea7a5a1763fe53fe699aa0feae4231 upstream.`.
>
> It is not safe to call filemap_fdatawrite_range() from
> nfs_async_write_reschedule_io(), since we're often calling from a page
> reclaim context. Just let fsync() redrive the writeback for us.
>
> Signed-off-by: Trond Myklebust <trond.myklebust at hammerspace.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
> (cherry picked from commit 31545f4b7cdb6da6a0519120b8c96dc40f186aac)
Since you're now picking the commit from upstream stable, that line
should read (cherry picked from commit
31545f4b7cdb6da6a0519120b8c96dc40f186aac linux-5.15.y).
> Fixes: 7be7b3ca16a59 ("NFS: Ensure we immediately start writeback on rescheduled writes")
> Link: https://lore.kernel.org/stable/2024112146-tiptoeing-available-c5fe@gregkh/T/
> Closes: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2089410
I don't think we strictly need these 3 extra lines above that don't
exist in the original commit.
> Signed-off-by: Mike Snitzer <snitzer at hammerspace.com>
> Signed-off-by: Mike Snitzer <snitzer at kernel.org>
> ---
> fs/nfs/write.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index 2e1c45344d1fd..00e11c6602fe4 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -1437,8 +1437,6 @@ static void nfs_async_write_error(struct list_head *head, int error)
> static void nfs_async_write_reschedule_io(struct nfs_pgio_header *hdr)
> {
> nfs_async_write_error(&hdr->pages, 0);
> - filemap_fdatawrite_range(hdr->inode->i_mapping, hdr->args.offset,
> - hdr->args.offset + hdr->args.count - 1);
> }
>
> static const struct nfs_pgio_completion_ops nfs_async_write_completion_ops = {
In summary, cherry pick the commit appending the `(cherry picked from
<hash> linux-5.15.y)` line, add the Launchpad BugLink immediately after
the commit subject (exactly as you did) and add your Signed-off-by line
right below the `(cherry picked from)` line.
Also, could you send the patch in reply to the cover letter?
Magali
More information about the kernel-team
mailing list