From mboxrd@z Thu Jan 1 00:00:00 1970 References: <909d4cae-ddd2-3951-eee8-8dec8faa6f22@redhat.com> From: Zdenek Kabelac Message-ID: <8a27504b-1b3a-7126-7ade-18f57b819ead@redhat.com> Date: Wed, 23 Oct 2019 15:05:14 +0200 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [linux-lvm] exposing snapshot block device Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: LVM general discussion and development , Ilia Zykov Dne 23. 10. 19 v 14:20 Ilia Zykov napsal(a): > On 23.10.2019 14:08, Gionatan Danti wrote: >> >> For example, consider a completely filled 64k chunk thin volume (with >> thinpool having ample free space). Snapshotting it and writing a 4k >> block on origin will obviously cause a read of the original 64k chunk, >> an in-memory change of the 4k block and a write of the entire modified >> 64k block to a new location. But writing, say, a 1 MB block should *not* >> cause the same read on source: after all, the read data will be >> immediately discarded, overwritten by the changed 1 MB block. >> >> However, my testing shows that source chunks are always read, even when >> completely overwritten. > > Not only read but sometimes write. > I watched it without snapshot. Only zeroing was enabled. Before wrote > new chunks "dd bs=1048576 ..." chunks were zeroed. But for security it's > good. IMHO: In this case good choice firstly write chunks to the disk > and then give this chunks to the volume. Yep - we are recommending to disable zeroing as soon as chunksize >512K. But for 'security' reason the option it's up to users to select what fits the needs in the best way - there is no 'one solution fits them all' in this case. Clearly when you put a modern filesystem (ext4, xfs...) on top of thinLV - you can't read junk data - filesystem knows very well about written portions. But if you will access thinLV device on 'block-level' with 'dd' command you might see some old data trash if zeroing is disabled... For smaller chunksizes zeroing is usually not a big deal - with bigger chunks it slows down initial provisioning in major way - but once the block is provisioned there are no further costs.... Regards Zdenek