Util-Linux Archive on lore.kernel.org
 help / Atom feed
* libblkid filesystem block size
@ 2018-10-03 21:41 Mikulas Patocka
  2018-10-04  9:43 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Mikulas Patocka @ 2018-10-03 21:41 UTC (permalink / raw)
  To: Vojtech Trefny, Karel Zak; +Cc: Mike Snitzer, dm-devel, lvm-devel, util-linux

Hi

As you maintain libblkid, I'd like to ask - would it be possible to add 
detection of filesystem block size to it? libblkid already has description 
of various filesystem superblocks, so it shouldn't be too hard.

LVM needs to know the block size because when it enables caching for a 
logical volume using the dm-writecache target or integrity protection 
using the dm-integrity target, the block size of the device mapper target 
should match the block size of the underlying filesystem (if the cache has 
smaller block size than the filesystem, it is inefficient, if the cache 
has larger block size than the filesystem, the filesystem won't mount).

Caching or integrity protection can be enabled on the fly for existing 
logical volumes (mounted or not mounted). XFS creates filesystems with 
512-byte block size even on some modern SSDs, so the problem with small 
block size exists even today.

Mikulas

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: libblkid filesystem block size
  2018-10-03 21:41 libblkid filesystem block size Mikulas Patocka
@ 2018-10-04  9:43 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2018-10-04  9:43 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: Vojtech Trefny, Mike Snitzer, dm-devel, lvm-devel, util-linux


 Ahoj,

On Wed, Oct 03, 2018 at 05:41:59PM -0400, Mikulas Patocka wrote:
> As you maintain libblkid, I'd like to ask - would it be possible to add 
> detection of filesystem block size to it? libblkid already has description 
> of various filesystem superblocks, so it shouldn't be too hard.

we had something like this (and also FS size) in our TODO for years.
So, I don't see problem to add it now. Send patch ;-)

All you need is to add 

 libblkid/src/superblocks/superblocks.c: blkid_probe_set_fs_blocksize() 

to add "BLKSZ" variable to the probing result (use for example
blkid_probe_set_version() as a template).

And then use this function in FS specific probers. The variable will
automatically visible for udev as ID_FS_BLKSZ=.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03 21:41 libblkid filesystem block size Mikulas Patocka
2018-10-04  9:43 ` Karel Zak

Util-Linux Archive on lore.kernel.org

Archives are clonable: git clone --mirror https://lore.kernel.org/util-linux/0 util-linux/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 util-linux util-linux/ https://lore.kernel.org/util-linux \
		util-linux@vger.kernel.org util-linux@archiver.kernel.org
	public-inbox-index util-linux


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.util-linux


AGPL code for this site: git clone https://public-inbox.org/ public-inbox