Re: [PATCH v3] ext4: fix hole punch failure when depth is greaterthan 0
From: Theodore Ts'o
Date: Sun Jul 22 2012 - 20:34:42 EST
On Tue, Jul 10, 2012 at 09:56:10PM +0530, Ashish Sangwan wrote:
> Whether to continue removing extents or not is decided by the return value
> of function ext4_ext_more_to_rm() which checks 2 conditions:
> a) if there are no more indexes to process.
> b) if the number of entries are decreased in the header of "depth -1".
> In case of hole punch, if the last block to be removed is not part of the
> last extent index than this index will not be deleted, hence the number of
> valid entries in the extent header of "depth - 1" will remain as it is and
> ext4_ext_more_to_rm will return 0 although the required blocks are not
> yet removed.
> This patch fixes the above mentioned problem as instead of removing the
> extents from the end of file, it starts removing the blocks from the
> particular extent from which removing blocks is actually required and
> continue backward until done.
> Signed-off-by: Ashish Sangwan <ashish.sangwan2@xxxxxxxxx>
> Signed-off-by: Namjae Jeon <linkinjeon@xxxxxxxxx>
> Reviewed-by: Lukas Czerner <lczerner@xxxxxxxxxx>
Applied, with a cc: to stable@xxxxxxxxxx since it is a bug fix.
Thanks for submitting this patch!
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/