]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ocfs2: Fix start offset to ocfs2_zero_range_for_truncate()
authorAshish Samant <ashish.samant@oracle.com>
Wed, 3 Aug 2016 02:26:30 +0000 (19:26 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 26 Aug 2016 21:17:47 +0000 (14:17 -0700)
commitb9b82c9adacc20aa3a4d8e0f7e0e18b84995a7a6
treeb5aa2c170ef5a306add17e9a2342b8bd42786abb
parenta6f09ec6badee113e6f582b73b93a51a57e56603
ocfs2: Fix start offset to ocfs2_zero_range_for_truncate()

If we punch a hole on a reflink such that following conditions are met:

1. start offset is on a cluster boundary
2. end offset is not on a cluster boundary
3. (end offset is somewhere in another extent) or
   (hole range > MAX_CONTIG_BYTES(1MB)),

we dont COW the first cluster starting at the start offset. But in this
case, we were wrongly passing this cluster to
ocfs2_zero_range_for_truncate() to zero out. This will modify the cluster
in place and zero it in the source too.

Fix this by skipping this cluster in such a scenario.

Orabug: 24516161

Reported-by: Saar Maoz <saar.maoz@oracle.com>
Signed-off-by: Ashish Samant <ashish.samant@oracle.com>
Reviewed-by: Srinivas Eeda <srinivas.eeda@oracle.com>
fs/ocfs2/file.c