summaryrefslogtreecommitdiff
path: root/sys/lib/libsa/ext2fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/lib/libsa/ext2fs.c')
-rw-r--r--sys/lib/libsa/ext2fs.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/lib/libsa/ext2fs.c b/sys/lib/libsa/ext2fs.c
index b810947fdaf..007c732dfac 100644
--- a/sys/lib/libsa/ext2fs.c
+++ b/sys/lib/libsa/ext2fs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ext2fs.c,v 1.30 2022/04/19 09:25:38 skrll Exp $ */
+/* $NetBSD: ext2fs.c,v 1.31 2022/04/24 06:48:15 mlelstv Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer.
@@ -415,9 +415,15 @@ read_sblock(struct open_file *f, struct m_ext2fs *fs)
struct ext2fs ext2fs;
size_t buf_size;
int rc;
+ u_int secsize;
+
+ secsize = 0;
+ rc = DEV_IOCTL(f->f_dev)(f, SAIOSECSIZE, &secsize);
+ if (rc != 0 || secsize == 0)
+ secsize = DEV_BSIZE;
rc = DEV_STRATEGY(f->f_dev)(f->f_devdata, F_READ,
- SBOFF / DEV_BSIZE, SBSIZE, sbbuf, &buf_size);
+ SBOFF / secsize, SBSIZE, sbbuf, &buf_size);
if (rc)
return rc;