OCFS2-Devel Archive mirror
 help / color / mirror / Atom feed
From: Greg KH via Ocfs2-devel <ocfs2-devel@oss.oracle.com>
To: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Jan Kara <jack@suse.cz>,
	stable@vger.kernel.org,
	Jan Kara via Ocfs2-devel <ocfs2-devel@oss.oracle.com>
Subject: Re: [Ocfs2-devel] [PATCH] ocfs2: fix data corruption after failed	write
Date: Tue, 28 Mar 2023 15:52:35 +0200	[thread overview]
Message-ID: <ZCLxIwF1Yfi35tqk@kroah.com> (raw)
In-Reply-To: <20230321032024.165992-1-joseph.qi@linux.alibaba.com>

On Tue, Mar 21, 2023 at 11:20:24AM +0800, Joseph Qi wrote:
> From: Jan Kara via Ocfs2-devel <ocfs2-devel@oss.oracle.com>
> 
> commit 90410bcf873cf05f54a32183afff0161f44f9715 upstream.
> 
> When buffered write fails to copy data into underlying page cache page,
> ocfs2_write_end_nolock() just zeroes out and dirties the page.  This can
> leave dirty page beyond EOF and if page writeback tries to write this page
> before write succeeds and expands i_size, page gets into inconsistent
> state where page dirty bit is clear but buffer dirty bits stay set
> resulting in page data never getting written and so data copied to the
> page is lost.  Fix the problem by invalidating page beyond EOF after
> failed write.
> 
> Link: https://lkml.kernel.org/r/20230302153843.18499-1-jack@suse.cz
> Fixes: 6dbf7bb55598 ("fs: Don't invalidate page buffers in block_write_full_page()")
> Signed-off-by: Jan Kara <jack@suse.cz>
> Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> Cc: Mark Fasheh <mark@fasheh.com>
> Cc: Joel Becker <jlbec@evilplan.org>
> Cc: Junxiao Bi <junxiao.bi@oracle.com>
> Cc: Changwei Ge <gechangwei@live.cn>
> Cc: Gang He <ghe@suse.com>
> Cc: Jun Piao <piaojun@huawei.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> [ replace block_invalidate_folio to block_invalidatepage ]
> Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
>  fs/ocfs2/aops.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 

Now queued up, thanks.

greg k-h

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

  reply	other threads:[~2023-03-28 13:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 11:57 [Ocfs2-devel] FAILED: patch "[PATCH] ocfs2: fix data corruption after failed write" failed to apply to 4.19-stable tree gregkh--- via Ocfs2-devel
2023-03-21  3:20 ` [Ocfs2-devel] [PATCH] ocfs2: fix data corruption after failed write Joseph Qi via Ocfs2-devel
2023-03-28 13:52   ` Greg KH via Ocfs2-devel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-03-20 11:57 [Ocfs2-devel] FAILED: patch "[PATCH] ocfs2: fix data corruption after failed write" failed to apply to 5.10-stable tree gregkh--- via Ocfs2-devel
2023-03-21  3:00 ` [Ocfs2-devel] [PATCH] ocfs2: fix data corruption after failed write Joseph Qi via Ocfs2-devel
2023-03-02 15:38 [Ocfs2-devel] [PATCH] ocfs2: Fix " Jan Kara via Ocfs2-devel
2023-03-03 10:55 ` Joseph Qi via Ocfs2-devel

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=ZCLxIwF1Yfi35tqk@kroah.com \
    --to=ocfs2-devel@oss.oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jack@suse.cz \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=stable@vger.kernel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).