If we want to use FALLOC_FL_PUNCH_HOLE, the documentation tells us we
also need to use FALLOC_FL_KEEP_SIZE.
Discovered-By: Nicolas Trangez
if(prev.startoff <= req->from) {
off_t curoff = req->from - prev.startoff;
off_t curlen = cur.startoff - prev.startoff - curoff;
- fallocate(prev.fhandle, FALLOC_FL_PUNCH_HOLE, curoff, curlen);
+ fallocate(prev.fhandle, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, curoff, curlen);
}
prev = cur;
} while(i < client->export->len && cur.startoff < (req->from + req->len));