]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: zero posteof blocks when cloning above eof
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 5 Oct 2018 09:04:27 +0000 (19:04 +1000)
committerDave Chinner <david@fromorbit.com>
Fri, 5 Oct 2018 09:04:27 +0000 (19:04 +1000)
commit98f62ec49f1d1cf0b58575e0973c70ef1c03d993
treeb47c895971b7fd030a4b0ba3e0503fd1f7f8c274
parenta75f307a1b2dca782ab6431a799136eb424551ba
xfs: zero posteof blocks when cloning above eof

When we're reflinking between two files and the destination file range
is well beyond the destination file's EOF marker, zero any posteof
speculative preallocations in the destination file so that we don't
expose stale disk contents.  The previous strategy of trying to clear
the preallocations does not work if the destination file has the
PREALLOC flag set.

Uncovered by shared/010.

Reported-by: Zorro Lang <zlang@redhat.com>
Bugzilla-id: https://bugzilla.kernel.org/show_bug.cgi?id=201259
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_reflink.c