[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server |
Date: |
Wed, 20 Jul 2016 12:37:09 +0800 |
User-agent: |
Mutt/1.6.1 (2016-04-27) |
On Tue, 07/19 21:47, Eric Blake wrote:
> > In block/raw-posix.c:handle_aiocb_write_zeroes():
> >> #ifdef CONFIG_FALLOCATE_PUNCH_HOLE
> >> if (s->has_discard && s->has_fallocate) {
> >> int ret = do_fallocate(s->fd,
> >> FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> >> aiocb->aio_offset, aiocb->aio_nbytes);
> >> if (ret == 0) {
> >> ret = do_fallocate(s->fd, 0, aiocb->aio_offset,
> >> aiocb->aio_nbytes);
>
> That is just implementation: punch a hole, BUT THEN reallocate it back,
> so that in the end, the file is still not sparse in that region. Or am
> I reading it wrong?
Yes, you are right about this, I was confused because "qemu-img map" does not
report this allocation state after zero write. (No idea why SEEK_DATA doesn't
hit the fallocate'ed area.)
Then, when it comes to qcow2, it's a bit different: after a NO_HOLE write zero
doesn't allocate anything, it only sets the bit in cluster table. In other
words, NO_HOLE only ensures allocated clusters are not deallocated, but it
doesn't ensure the population of previously unallocated area. Is that intended?
Fam
- [Qemu-devel] [PATCH v5 01/14] nbd: Fix bad flag detection on server, (continued)
- [Qemu-devel] [PATCH v5 01/14] nbd: Fix bad flag detection on server, Eric Blake, 2016/07/19
- [Qemu-devel] [PATCH v5 09/14] nbd: Let client skip portions of server reply, Eric Blake, 2016/07/19
- [Qemu-devel] [PATCH v5 08/14] nbd: Let server know when client gives up negotiation, Eric Blake, 2016/07/19
- [Qemu-devel] [PATCH v5 03/14] nbd: Limit nbdflags to 16 bits, Eric Blake, 2016/07/19
- [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Eric Blake, 2016/07/19
- Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Fam Zheng, 2016/07/19
- Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Eric Blake, 2016/07/19
- Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Paolo Bonzini, 2016/07/19
- Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Fam Zheng, 2016/07/19
- Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Eric Blake, 2016/07/19
- Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server,
Fam Zheng <=
- Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Paolo Bonzini, 2016/07/20
- Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Fam Zheng, 2016/07/20
- Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Paolo Bonzini, 2016/07/20
- Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Fam Zheng, 2016/07/20
- [Qemu-devel] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server), Paolo Bonzini, 2016/07/20
- Re: [Qemu-devel] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server), Dave Chinner, 2016/07/20
- Re: [Qemu-devel] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server), Niels de Vos, 2016/07/20
- Re: [Qemu-devel] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server), Dave Chinner, 2016/07/21
- Re: [Qemu-devel] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server), Pádraig Brady, 2016/07/21
- Re: [Qemu-devel] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server), Dave Chinner, 2016/07/21