On Fri, 22 Mar 2024, Ming Lei wrote:
> If logical block becomes mismatched by reconfiguration, the whole DM stack
> can't work:
>
> - at the beginning, DM is over NVMe(512 bs), DM & NVMe lbs is 512
> - later, nvme is reconfigured and its lbs becomes 4k, but DM's lbs can't
> be updated
> - then unaligned IO is submitted to NVMe
>
> So DM _never_ works with mis-matched logical block size because of
> reconfigure, and same with MD.
It can work. If a filesystem has 4k block size and it is used on a block
device with misconfigured with 512-byte sector size, it will work.
The buffer cache also prefers using page-sized blocks rather than logical
block size, so it will work too.
> > But yes, it works with 64K PAGE_SIZE.
>
> Fine, but I still think PAGE_SIZE is hard to follow than logical block
> size.
>
> Thanks,
> Ming
The temporary buffer has one page, so I restricted the alignment to
PAGE_SIZE. logical block size is always <= PAGE_SIZE.
Mikulas