[PATCH v2] xfs: probe data buffer from page cache for unwritten extents
Mark Tinguely
tinguely at sgi.com
Mon Jun 25 11:13:05 CDT 2012
On 06/25/12 07:41, Jeff Liu wrote:
> Hello,
>
> Using the start offset rather than map->br_startoff to calculate the starting page index could
> get more accurate data offset in page cache probe routine.
> With this refinement, the old max_t() could be able to remove too.
>
> Thanks Mark for pointing this out!
>
> -Jeff
>
>
> Cc: Mark Tinguely<tinguely at sgi.com>
> Signed-off-by: Jie Liu<jeff.liu at oracle.com>
>
> ---
> + /*
> + * xfs_bmapi_read() can handle repeated hole regions,
> + * hence it should not return two extents both are
> + * holes. If the 2nd extent is unwritten, there must
> + * have data buffer resides in page cache.
> + */
> + BUG();
Looks great.
I hit the BUG() using a test with the following test:
hole
unwritten (treated as a hole)
unwritten (treated as a hole)
page of data.
I will send the current version of the test program.
--Mark.
More information about the xfs
mailing list