Re: review: make xfs_dm_punch_hole() atomic when punching EOF

Vlad Apostolov
2007-05-21T02:15:27Z

It is looking good Dave.

Regards,
Vlad

David Chinner wrote:
> Currently punching a hole to EOF via xfs_dm_punch_hole()
> truncates the file and then extends it. This leaves a small
> window where applications can see an incorrect file size
> while the punch is in progress. This can cause problems
> with DMF leading to premature completion of recalls and
> hence data corruption.
>
> Use the UNRESVSP ioctl rather than FREESP+setattr to punch the
> hole at EOF. This can leave specualtive allocations past EOF,
> so truncate them off so we don't leave blocks that can't be
> migrated away around in the filesystem.
>
> Cheers,
>
> Dave.
>