Fix a bug in vmntvnodescan() revealed by the recent NFS sync fix. The
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 14 Jul 2008 22:16:35 +0000 (22:16 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 14 Jul 2008 22:16:35 +0000 (22:16 +0000)
function can improperly return -1 if the last element scanned is skipped
by the fastfunc.

sys/kern/vfs_mount.c

index f67f991..73048f2 100644 (file)
@@ -67,7 +67,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $DragonFly: src/sys/kern/vfs_mount.c,v 1.35 2008/07/08 03:34:27 dillon Exp $
+ * $DragonFly: src/sys/kern/vfs_mount.c,v 1.36 2008/07/14 22:16:35 dillon Exp $
  */
 
 /*
@@ -944,8 +944,10 @@ vmntvnodescan(
                 * A positive number aborts the loop.
                 */
                if (fastfunc) {
-                       if ((r = fastfunc(mp, vp, data)) < 0)
+                       if ((r = fastfunc(mp, vp, data)) < 0) {
+                               r = 0;
                                goto next;
+                       }
                        if (r)
                                break;
                }