aboutsummaryrefslogtreecommitdiff
path: root/mm/damon
diff options
context:
space:
mode:
authorJan Kara via Ocfs2-devel2023-03-02 16:38:43 +0100
committerAndrew Morton2023-03-07 17:04:55 -0800
commit90410bcf873cf05f54a32183afff0161f44f9715 (patch)
treedefd35ddea861acb6dc965248aae7c99356d5c10 /mm/damon
parent2ef7dbb269902bde34c82f027806992195d1d1ee (diff)
ocfs2: fix data corruption after failed write
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>
Diffstat (limited to 'mm/damon')
0 files changed, 0 insertions, 0 deletions