[git commit] volume_id: volume_id_get_buffer with small FSes

Denys Vlasenko vda.linux at googlemail.com
Wed Feb 4 12:30:24 UTC 2026


commit: https://git.busybox.net/busybox/commit/?id=7310339e73d369e9636d1f44446234f58b4ca54e
branch: https://git.busybox.net/busybox/log/?h=master

I was working with some very small ext4 filesystems, used for
overlaying on immutable VM/container images.  If it's only desired to
overlay a single config file, these filesystems can be very small
indeed, and so ran afoul of this length check.

Since 4fc5ec56f ("device matching against UUIDs: do not try
floppies") (from 2009), floppy drives are skipped before this function
is even called.  Reading from an unused loop device returns 0, so it
should be fine to reduce  the minimum length.

Signed-off-by: Alyssa Ross via busybox <busybox at busybox.net>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 util-linux/volume_id/util.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/util-linux/volume_id/util.c b/util-linux/volume_id/util.c
index ddfe98d50..b154f9378 100644
--- a/util-linux/volume_id/util.c
+++ b/util-linux/volume_id/util.c
@@ -233,11 +233,10 @@ void *volume_id_get_buffer(struct volume_id *id, uint64_t off, size_t len)
  err:
 		/* No filesystem can be this tiny. It's most likely
 		 * non-associated loop device, empty drive and so on.
-		 * Flag it, making it possible to short circuit future
-		 * accesses. Rationale:
+		 * Flag it, avoiding future accesses. Rationale:
 		 * users complained of slow blkid due to empty floppy drives.
 		 */
-		if (off < 64*1024)
+		if (off <= 1024)
 			id->error = 1;
 		/* id->seekbuf_len or id->sbbuf_len is wrong now! Fixing. */
 		volume_id_free_buffer(id);


More information about the busybox-cvs mailing list