zfsonlinux/zfs — pull request #2744 by dweeezil (2014-09-26 04:49:00+00:00)
Title: Perform whole-page page truncation for hole-punching under a range lock

As an attempt to perform the page truncation more optimally, the
hole-punching support added in 223df0161fad50f53a8fa5ffeea8cc4f8137d522
truncated performed the operation in two steps: first, sub-page "stubs"
were zeroed under the range lock in zfs_free_range() using the new
zfs_zero_partial_page() function and then the whole pages were truncated
within zfs_freesp(). This left a window of opportunity during which
the full pages could be touched.

This patch closes the window by moving the whole-page trunction into
zfs_free_range() under the range lock.

Fixes #2733.