git: 62aef3f73f38 - main - vfs_cluster.c: Do not propagate VOP_BMAP errors to the caller

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Wed, 22 Oct 2025 16:59:51 UTC
The branch main has been updated by arrowd:

URL: https://cgit.FreeBSD.org/src/commit/?id=62aef3f73f38db9fb68bffc12cc8900fecd58f0e

commit 62aef3f73f38db9fb68bffc12cc8900fecd58f0e
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-07-11 07:42:09 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-10-22 16:59:21 +0000

    vfs_cluster.c: Do not propagate VOP_BMAP errors to the caller
    
    The code that makes this VOP_BMAP call tries to perform a read-ahead I/O
    operation. Failing to do that for any reason isn't fatal for `cluster_read()`,
    because we still can return some data to the caller. This change is consistent
    with other places within `cluster_read()`, where error returned by VOP_BMAP is
    not returned to the caller - see the `if (nblks > 1)` block above the changed
    lines and `if (reqbp)` at the end of the function.
    
    PR:     264196
    Approved by:    markj, kib
    Differential Revision: https://reviews.freebsd.org/D51254
---
 sys/kern/vfs_cluster.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index 2e397b8e9e8f..b674313993c4 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -260,8 +260,10 @@ cluster_read(struct vnode *vp, u_quad_t filesize, daddr_t lblkno, long size,
 	 */
 	while (lblkno < (origblkno + maxra)) {
 		error = VOP_BMAP(vp, lblkno, NULL, &blkno, &ncontig, NULL);
-		if (error)
+		if (error) {
+			error = 0;
 			break;
+		}
 
 		if (blkno == -1)
 			break;