aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Popov <arrowd@FreeBSD.org>2025-07-11 07:42:09 +0000
committerGleb Popov <arrowd@FreeBSD.org>2025-10-22 16:59:21 +0000
commit62aef3f73f38db9fb68bffc12cc8900fecd58f0e (patch)
tree49ddeb308e24e5190ac980e238acd7b2f554511a
parent1dd66c6ac2c146f540b2ff825fbee442354aeee5 (diff)
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
-rw-r--r--sys/kern/vfs_cluster.c4
1 files changed, 3 insertions, 1 deletions
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;