Re: [PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-02-08 Thread Michael Tokarev
09.02.2024 00:21, Stefan Hajnoczi wrote: On Thu, 1 Feb 2024 at 06:37, Michael Tokarev wrote: for (;;) { -bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS); +bytes = MIN(size - offset, BDRV_REQUEST_MAX_BYTES); Hmm. This smells like a -stable material, but you know

Re: [PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-02-08 Thread Stefan Hajnoczi
On Thu, 1 Feb 2024 at 06:37, Michael Tokarev wrote: > > 30.01.2024 03:27, Stefan Hajnoczi wrote: > > The following expression is incorrect because blk_pread_nonzeroes() > > deals in units of bytes, not sectors: > > > >bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS) > >

Re: [PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-02-01 Thread Michael Tokarev
30.01.2024 03:27, Stefan Hajnoczi wrote: The following expression is incorrect because blk_pread_nonzeroes() deals in units of bytes, not sectors: bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS) ^^^ BDRV_REQUEST_MAX_BYTES is the appropr

Re: [PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-01-30 Thread Stefan Hajnoczi
On Mon, Jan 29, 2024 at 07:27:12PM -0500, Stefan Hajnoczi wrote: > The following expression is incorrect because blk_pread_nonzeroes() > deals in units of bytes, not sectors: > > bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS) > ^^^ > > BDR

Re: [PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-01-30 Thread Philippe Mathieu-Daudé
On 30/1/24 01:27, Stefan Hajnoczi wrote: The following expression is incorrect because blk_pread_nonzeroes() deals in units of bytes, not sectors: bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS) ^^^ BDRV_REQUEST_MAX_BYTES is the appropr

[PATCH] pflash: fix sectors vs bytes confusion in blk_pread_nonzeroes()

2024-01-29 Thread Stefan Hajnoczi
The following expression is incorrect because blk_pread_nonzeroes() deals in units of bytes, not sectors: bytes = MIN(size - offset, BDRV_REQUEST_MAX_SECTORS) ^^^ BDRV_REQUEST_MAX_BYTES is the appropriate constant. Fixes: a4b15a8b9ef2 ("pflash: