From: "Darrick J. Wong" <djwong@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] iomap: fix memory corruption when recording errors during writeback
Date: Thu, 29 Sep 2022 14:27:17 -0700 [thread overview]
Message-ID: <YzYNtYgU1ckryg4Q@magnolia> (raw)
In-Reply-To: <YzXy8lJGMRUbEdsM@casper.infradead.org>
On Thu, Sep 29, 2022 at 08:33:06PM +0100, Matthew Wilcox wrote:
> On Thu, Sep 29, 2022 at 11:44:49AM -0700, Darrick J. Wong wrote:
> > Fixes: e735c0079465 ("iomap: Convert iomap_add_to_ioend() to take a folio")
> > Probably-Fixes: 598ecfbaa742 ("iomap: lift the xfs writeback code to iomap")
>
> I think this is a misuse of Fixes. As I understand it, Fixes: is "Here's
> the commit that introduced the bug", not "This is the most recent change
> after which this patch will still apply". e735c0079465 only changed
> s/page/folio/ in this line of code, so clearly didn't introduce the bug.
>
> Any kernel containing 598ecfbaa742 has this same bug, so that should be
> the Fixes: line. As you say though, 598ecfbaa742 merely moved the code
> from xfs_writepage_map(). bfce7d2e2d5e moved it from xfs_do_writepage(),
> but 150d5be09ce4 introduced it. Six years ago! Good find. So how about:
>
> Fixes: 150d5be09ce4 ("xfs: remove xfs_cancel_ioend")
Sounds fine to me, though if I hear complaints from AUTOSEL about how
the patch does not directly apply to old kernels, I'll forward them to
you, because that's what I do now to avoid getting even /more/ email.
> Also,
>
> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
However, thank you for the quick review. :)
--D
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> > fs/iomap/buffered-io.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> > index ca5c62901541..77d59c159248 100644
> > --- a/fs/iomap/buffered-io.c
> > +++ b/fs/iomap/buffered-io.c
> > @@ -1421,7 +1421,7 @@ iomap_writepage_map(struct iomap_writepage_ctx *wpc,
> > if (!count)
> > folio_end_writeback(folio);
> > done:
> > - mapping_set_error(folio->mapping, error);
> > + mapping_set_error(inode->i_mapping, error);
> > return error;
> > }
> >
next prev parent reply other threads:[~2022-09-29 21:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-29 18:44 [PATCH] iomap: fix memory corruption when recording errors during writeback Darrick J. Wong
2022-09-29 19:33 ` Matthew Wilcox
2022-09-29 21:27 ` Darrick J. Wong [this message]
2022-09-29 21:29 ` Matthew Wilcox
2022-09-29 23:10 ` Darrick J. Wong
2022-09-29 21:59 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YzYNtYgU1ckryg4Q@magnolia \
--to=djwong@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox