Re: [Libguestfs] nbdkit blocksize filter, read-modify-write, and concurrency

2022-05-25 Thread Nikolaus Rath
On May 25 2022, Eric Blake wrote: > On Tue, May 24, 2022 at 08:45:02PM +0100, Nikolaus Rath wrote: >> > However, you are worried that a third possibility occurs: >> > >> > T2 sees that it needs to do RMW, grabs the lock, and reads 0x00-0x0f >> > for the unaligned head (it only needs 0x00-0x03,

Re: [Libguestfs] nbdkit blocksize filter, read-modify-write, and concurrency

2022-05-25 Thread Eric Blake
On Tue, May 24, 2022 at 08:45:02PM +0100, Nikolaus Rath wrote: > > However, you are worried that a third possibility occurs: > > > > T2 sees that it needs to do RMW, grabs the lock, and reads 0x00-0x0f > > for the unaligned head (it only needs 0x00-0x03, but we have to read a > > block at a time),

Re: [Libguestfs] nbdkit blocksize filter, read-modify-write, and concurrency

2022-05-24 Thread Nikolaus Rath
On May 24 2022, Eric Blake wrote: > minblock = 0x10 > Thread 1: receives write request for offset 0x00, size 0x10 (aligned request) > Thread 2: receives write request for offset 0x04, size 0x16 (unaligned > offset, unaligned size) > > Graphically, we are wanting to write the following, given

Re: [Libguestfs] nbdkit blocksize filter, read-modify-write, and concurrency

2022-05-24 Thread Richard W.M. Jones
On Tue, May 24, 2022 at 09:01:28AM -0500, Eric Blake wrote: > On Sat, May 21, 2022 at 01:21:11PM +0100, Nikolaus Rath wrote: > > Hi, > > > > How does the blocksize filter take into account writes that end-up > > overlapping due to read-modify-write cycles? > > > > Specifically, suppose there

Re: [Libguestfs] nbdkit blocksize filter, read-modify-write, and concurrency

2022-05-24 Thread Eric Blake
On Sat, May 21, 2022 at 01:21:11PM +0100, Nikolaus Rath wrote: > Hi, > > How does the blocksize filter take into account writes that end-up > overlapping due to read-modify-write cycles? > > Specifically, suppose there are two non-overlapping writes handled by two > different threads, that,

Re: [Libguestfs] nbdkit blocksize filter, read-modify-write, and concurrency

2022-05-22 Thread Richard W.M. Jones
On Sat, May 21, 2022 at 05:37:10PM +0100, Nikolaus Rath wrote: > On May 21 2022, "Richard W.M. Jones" wrote: > > On Sat, May 21, 2022 at 01:21:11PM +0100, Nikolaus Rath wrote: > >> Hi, > >> > >> How does the blocksize filter take into account writes that end-up > >> overlapping due to

Re: [Libguestfs] nbdkit blocksize filter, read-modify-write, and concurrency

2022-05-21 Thread Nikolaus Rath
On May 21 2022, "Richard W.M. Jones" wrote: > On Sat, May 21, 2022 at 01:21:11PM +0100, Nikolaus Rath wrote: >> Hi, >> >> How does the blocksize filter take into account writes that end-up >> overlapping due to read-modify-write cycles? >> >> Specifically, suppose there are two non-overlapping

Re: [Libguestfs] nbdkit blocksize filter, read-modify-write, and concurrency

2022-05-21 Thread Richard W.M. Jones
On Sat, May 21, 2022 at 01:21:11PM +0100, Nikolaus Rath wrote: > Hi, > > How does the blocksize filter take into account writes that end-up > overlapping due to read-modify-write cycles? > > Specifically, suppose there are two non-overlapping writes handled > by two different threads, that, due to

[Libguestfs] nbdkit blocksize filter, read-modify-write, and concurrency

2022-05-21 Thread Nikolaus Rath
Hi, How does the blocksize filter take into account writes that end-up overlapping due to read-modify-write cycles? Specifically, suppose there are two non-overlapping writes handled by two different threads, that, due to blocksize requirements, overlap when expanded. I think there is a risk