system/physmem: take into account fd_offset for file fallocate
authorWilliam Roche <william.roche@oracle.com>
Wed, 22 Jan 2025 19:40:53 +0000 (19:40 +0000)
committerPeter Xu <peterx@redhat.com>
Tue, 11 Feb 2025 21:37:05 +0000 (16:37 -0500)
commitf051a9c4dc70cd1b6eafa61aec8f3b9344e02e85
tree5468f3003ace14e070bba5976578bae3c36e5917
parentffaf7f0376f8040ce9068d71ae9ae8722505c42e
system/physmem: take into account fd_offset for file fallocate

Punching a hole in a file with fallocate needs to take into account the
fd_offset value for a correct file location.
But guest_memfd internal use doesn't currently consider fd_offset.

Fixes: 4b870dc4d0c0 ("hostmem-file: add offset option")
Signed-off-by: William Roche <william.roche@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/r/20250122194053.3103617-2-william.roche@oracle.com
Signed-off-by: Peter Xu <peterx@redhat.com>
system/physmem.c