lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aSR6EZrxvlseRhZp@pc636>
Date: Mon, 24 Nov 2025 16:30:25 +0100
From: Uladzislau Rezki <urezki@...il.com>
To: Christoph Hellwig <hch@....de>
Cc: Uladzislau Rezki <urezki@...il.com>,
	Mikulas Patocka <mpatocka@...hat.com>,
	Benjamin Marzinski <bmarzins@...hat.com>,
	Alasdair Kergon <agk@...hat.com>, DMML <dm-devel@...ts.linux.dev>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Mike Snitzer <snitzer@...hat.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RESEND PATCH] dm-ebs: Mark full buffer dirty even on partial
 write

On Mon, Nov 24, 2025 at 03:30:44PM +0100, Christoph Hellwig wrote:
> On Fri, Nov 21, 2025 at 02:21:34PM +0100, Uladzislau Rezki wrote:
> > -               offset &= -DM_BUFIO_WRITE_ALIGN;
> > -               end += DM_BUFIO_WRITE_ALIGN - 1;
> > -               end &= -DM_BUFIO_WRITE_ALIGN;
> > +               align = max(DM_BUFIO_WRITE_ALIGN, bdev_logical_block_size(b->c->bdev));
> > +               offset &= -align;
> > +               end += align - 1;
> > +               end &= -align;
> >                 if (unlikely(end > b->c->block_size))
> >                         end = b->c->block_size;
> > <snip>
> > 
> > and it fixes the setup which i described in the commit message, but i
> > have question.
> 
> And this patch, using bdev_logical_block_size looks correct.
> 
> > 
> > Why in dm-ebs we need to offload partial buffer < ubf size?
> 
> I don't understand this question.  What is ubf?  What does partial
> buffer mean in this context, and what does offload mean?
> 
That was a typo :) i meant ubs - which is underlying block size or number
of sectors which define the logical block size of the device. In our case
it is 8K thus is 16 = 512 * 16 = 8K.

Partial buffer means, in context of dm-ebs, that within 8K buffer only
part of it can be modified. For example, since we emulate 512B to 8K
from upper layer to the device, a file system can write for example
just first 4K within 8K window buffer and only that part is marked as
dirty.

offloading or imposing the data to the lower layer. i.e. writing dirty
buffers to the device calling submit_io().

Is it better? It might be that i missed something, feel free to correct.

--
Uladzislau Rezki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ