svn commit: r345955 - head/sys/kern
Konstantin Belousov
kib at FreeBSD.org
Fri Apr 5 16:14:18 UTC 2019
Author: kib
Date: Fri Apr 5 16:14:16 2019
New Revision: 345955
URL: https://svnweb.freebsd.org/changeset/base/345955
Log:
vn_vmap_seekhole(): align running offset to the block boundary.
Otherwise we might miss the last iteration where EOF appears below
unaligned noff.
Reported and reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D19811
Modified:
head/sys/kern/vfs_vnops.c
Modified: head/sys/kern/vfs_vnops.c
==============================================================================
--- head/sys/kern/vfs_vnops.c Fri Apr 5 16:12:35 2019 (r345954)
+++ head/sys/kern/vfs_vnops.c Fri Apr 5 16:14:16 2019 (r345955)
@@ -2167,7 +2167,8 @@ vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *
goto unlock;
}
bsize = vp->v_mount->mnt_stat.f_iosize;
- for (bn = noff / bsize; noff < va.va_size; bn++, noff += bsize) {
+ for (bn = noff / bsize; noff < va.va_size; bn++, noff += bsize -
+ noff % bsize) {
error = VOP_BMAP(vp, bn, NULL, &bnp, NULL, NULL);
if (error == EOPNOTSUPP) {
error = ENOTTY;
More information about the svn-src-all
mailing list