git: 3564e33b6099 - stable/15 - ufs: ufs_bmap_seekdata() needs mapped buffer for scan
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 23 May 2026 07:13:50 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=3564e33b6099fcdfce4371fcf51c7f462823e012
commit 3564e33b6099fcdfce4371fcf51c7f462823e012
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-05-17 00:09:21 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-05-23 06:56:13 +0000
ufs: ufs_bmap_seekdata() needs mapped buffer for scan
PR: 295348
(cherry picked from commit 8ad8643a66735d28dac53a772856c94ca65b2bf3)
---
sys/ufs/ufs/ufs_bmap.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/sys/ufs/ufs/ufs_bmap.c b/sys/ufs/ufs/ufs_bmap.c
index 030cf3055477..1194820e6b07 100644
--- a/sys/ufs/ufs/ufs_bmap.c
+++ b/sys/ufs/ufs/ufs_bmap.c
@@ -59,7 +59,8 @@
#include <ufs/ufs/ufs_extern.h>
static ufs_lbn_t lbn_count(struct ufsmount *, int);
-static int readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t, struct buf **);
+static int readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t, bool,
+ struct buf **);
static int ufs_bmap_use_unmapped = 1;
@@ -104,6 +105,7 @@ static int
readindir(struct vnode *vp,
ufs_lbn_t lbn,
ufs2_daddr_t daddr,
+ bool allow_unmapped,
struct buf **bpp)
{
struct buf *bp;
@@ -116,7 +118,8 @@ readindir(struct vnode *vp,
ump = VFSTOUFS(mp);
ip = VTOI(vp);
- gbflags = !I_IS_UFS1(ip) && ufs_bmap_use_unmapped ? GB_UNMAPPED : 0;
+ gbflags = allow_unmapped && !I_IS_UFS1(ip) &&
+ ufs_bmap_use_unmapped ? GB_UNMAPPED : 0;
bp = getblk(vp, lbn, mp->mnt_stat.f_iosize, 0, 0, gbflags);
if ((bp->b_flags & B_CACHE) == 0) {
KASSERT(daddr != 0,
@@ -291,7 +294,7 @@ ufs_bmaparray(struct vnode *vp,
*/
if (bp)
bqrelse(bp);
- error = readindir(vp, metalbn, daddr, &bp);
+ error = readindir(vp, metalbn, daddr, true, &bp);
if (error != 0)
return (error);
@@ -525,7 +528,7 @@ ufs_bmap_seekdata(struct vnode *vp, off_t *offp)
for (; daddr != 0 && num > 0; ap++, num--) {
if (bp != NULL)
bqrelse(bp);
- error = readindir(vp, ap->in_lbn, daddr, &bp);
+ error = readindir(vp, ap->in_lbn, daddr, false, &bp);
if (error != 0)
return (error);