ibm-s390-linux / s390-tools

Tools for use with the s390 Linux kernel and device drivers
MIT License
63 stars 60 forks source link

zipl: use FIEMAP mapping ioctl if it exists #36

Closed sandeen closed 5 years ago

sandeen commented 6 years ago

zipl currently uses the FIBMAP ioctl to map blocks for the bootloader; on XFS, if FIBMAP is requested on a reflinked file, it will fail - and FIBMAP returns 0 in this case, which is indistinguishable from a hole. This causes boot to fail because the file is not mapped.

We can use the FIEMAP ioctl instead, which is able to map reflinked files. While FIEMAP is able to map entire extents at once, here we simply use it to obtain the mapping block-by-block so that it fits in with the current FIBMAP calls.

Signed-off-by: Eric Sandeen sandeen@redhat.com

stefan-haberland commented 6 years ago

Thanks for the patch. Looks good. Reviewed and tested.

The patch will be integrated soon.