On 12/12/2018 8:19 PM, Vladimir Sementsov-Ogievskiy wrote: > 05.12.2018 17:11, Anton Nefedov wrote: >> On 5/12/2018 4:25 PM, Vladimir Sementsov-Ogievskiy wrote: >>> 03.12.2018 13:14, Anton Nefedov wrote: >>>> } >>>> #endif >>>> >>>> - bs->supported_zero_flags = BDRV_REQ_MAY_UNMAP; >>>> + bs->supported_zero_flags |= BDRV_REQ_MAY_UNMAP; >>>> ret = 0; >>>> fail: >>>> if (filename && (bdrv_flags & BDRV_O_TEMPORARY)) { >>>> @@ -1520,6 +1522,10 @@ static ssize_t >>>> handle_aiocb_write_zeroes(RawPosixAIOData *aiocb) >>>> } >>>> s->has_fallocate = false; >>>> } >>>> + >>>> + if (!s->has_fallocate) { >>>> + aiocb->bs->supported_zero_flags &= ~BDRV_REQ_ALLOCATE; >>>> + } >>>>> #endif > > hm, if CONFIG_FALLOCATE is disabled, flag will remain in supported_zero_flags >
right.. I think there should be a separate patch to reset s->has_* in non-CONFIG_FALLOCATE* cases. Then I'll move this hunk just one line down under the following #endif