Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Sep 2019 14:06:44 -0000
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r345955 - head/sys/kern
Message-ID:  <201904051614.x35GEHTN085474@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904051614.x35GEHTN085474>