Fix wrong assertion hitting when all discard methods fail

Manually tested with this modification:

diff --git a/src/fellow_log.c b/src/fellow_log.c
index 6075d81..45da269 100644
--- a/src/fellow_log.c
+++ b/src/fellow_log.c
@@ -1696,6 +1696,9 @@ fellow_io_regions_discard(struct fellow_fd *ffd, void *ioctx,
                r = fallocate(ffd->fd,
                    FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE,
                    (off_t)todo->offset, (off_t)todo->len);
+               // XXX TEST
+               r = 1;
+               errno = EOPNOTSUPP;
                if (r == 0) {
                        if ((ffd->cap & FFD_CAN_FALLOCATE_PUNCH_URING) == 0) {
                                ffd->diag("fellow: fallocate punch"

Fixes #38
parent 3fccc602
......@@ -1718,7 +1718,8 @@ fellow_io_regions_discard(struct fellow_fd *ffd, void *ioctx,
#endif
nowork:
AZ(n);
if (ffd->cap & FFD_CAN_ANY)
AZ(n);
buddy_return1_ptr_extent(ffd->membuddy, &mem);
nomem:
if (! (ffd->cap & FFD_CAN_ANY))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment