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
This commit is contained in:
parent
a5a02ef49f
commit
4ae3f5a7fd
@ -2167,7 +2167,8 @@ vn_bmap_seekhole(struct vnode *vp, u_long cmd, off_t *off, struct ucred *cred)
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user