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.
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