On 1/14/25 15:00, David Hildenbrand wrote:
If we can get the current set of fixes integrated, I'll submit another
fix proposal to take the fd_offset into account in a second time. (Not
enlarging the current set)

But here is what I'm thinking about. That we can discuss later if you want:

@@ -3730,11 +3724,12 @@ int ram_block_discard_range(RAMBlock *rb,
uint64_t start, size_t length)
               }

               ret = fallocate(rb->fd, FALLOC_FL_PUNCH_HOLE |
FALLOC_FL_KEEP_SIZE,
-                            start, length);
+                            start + rb->fd_offset, length);
               if (ret) {
                   ret = -errno;
                   error_report("%s: Failed to fallocate %s:%" PRIx64 "
+%zx (%d)",
-                             __func__, rb->idstr, start, length, ret);
+                             __func__, rb->idstr, start + rb->fd_offset,
+                            length, ret);
                   goto err;
               }


Or I can integrate that as an addition patch if you prefer.

Very good point! We missed to take fd_offset into account here.

Can you send that out as a separate fix?

Fixed: 4b870dc4d0c0 ("hostmem-file: add offset option"

Thanks to Peter Xu and to you for your reviews of my proposal for this separate fix that should be on track to be integrated soon.



Reply via email to