Re: [PATCH] xfs: fix regression in "cleanup xfs_dir2_block_getdents"

From: Christoph Hellwig
Date: Thu Mar 12 2020 - 05:01:32 EST


On Thu, Mar 12, 2020 at 10:57:28AM +0200, Tommi Rantala wrote:
> Commit 263dde869bd09 ("xfs: cleanup xfs_dir2_block_getdents") introduced
> a getdents regression, when it converted the pointer arithmetics to
> offset calculations: offset is updated in the loop already for the next
> iteration, but the updated offset value is used incorrectly in two
> places, where we should have used the not-yet-updated value.
>
> This caused for example "git clean -ffdx" failures to cleanup certain
> directory structures when running in a container.
>
> Fix the regression by making sure we use proper offset in the loop body.
> Thanks to Christoph Hellwig for suggestion how to best fix the code.
>
> Cc: Christoph Hellwig <hch@xxxxxx>
> Fixes: 263dde869bd09 ("xfs: cleanup xfs_dir2_block_getdents")
> Signed-off-by: Tommi Rantala <tommi.t.rantala@xxxxxxxxx>

Looks good,

Reviewed-by: Christoph Hellwig <hch@xxxxxx>