Thu Jun 13 10:55:59 2013 UTC ()
Pull up following revision(s) (requested by reinoud in ticket #894):
	sys/fs/nilfs/nilfs_vnops.c: revision 1.22-1.23
Fix serious file read problem due to not-so-clear VOP_BMAP description. Should
fix PR 45605.


(msaitoh)
diff -r1.16.6.1 -r1.16.6.1.6.1 src/sys/fs/nilfs/nilfs_vnops.c

cvs diff -r1.16.6.1 -r1.16.6.1.6.1 src/sys/fs/nilfs/nilfs_vnops.c (expand / switch to context diff)
--- src/sys/fs/nilfs/nilfs_vnops.c 2012/08/12 12:59:47 1.16.6.1
+++ src/sys/fs/nilfs/nilfs_vnops.c 2013/06/13 10:55:59 1.16.6.1.6.1
@@ -1,4 +1,4 @@
-/* $NetBSD: nilfs_vnops.c,v 1.16.6.1 2012/08/12 12:59:47 martin Exp $ */
+/* $NetBSD: nilfs_vnops.c,v 1.16.6.1.6.1 2013/06/13 10:55:59 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2008, 2009 Reinoud Zandijk
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: nilfs_vnops.c,v 1.16.6.1 2012/08/12 12:59:47 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nilfs_vnops.c,v 1.16.6.1.6.1 2013/06/13 10:55:59 msaitoh Exp $");
 #endif /* not lint */
 
 
@@ -315,6 +315,11 @@
 /*
  * bmap functionality that translates logical block numbers to the virtual
  * block numbers to be stored on the vnode itself.
+ *
+ * Important alert!
+ *
+ * If runp is not NULL, the number of contiguous blocks __starting from the
+ * next block after the queried block__ will be returned in runp.
  */
 
 int
@@ -364,7 +369,8 @@
 	run = 1;
 	while ((run < blks) && (l2vmap[run] == *bnp + run))
 		run++;
-	
+	run--;	/* see comment at start of function */
+
 	/* set runlength */
 	if (runp)
 		*runp = run;