[Midnightbsd-cvs] src [7305] trunk/sys/sys/vnode.h: Fix kqueue write events for files > 2GB

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Sep 17 08:46:45 EDT 2015


Revision: 7305
          http://svnweb.midnightbsd.org/src/?rev=7305
Author:   laffer1
Date:     2015-09-17 08:46:44 -0400 (Thu, 17 Sep 2015)
Log Message:
-----------
Fix kqueue write events for files > 2GB

Due to the use of int's for file offsets in the VOP_WRITE_(PRE|POST)
macros, kqueue write events for files greater 2GB where never fired.

This caused tail -f on a file greater 2GB to never see updates.

Obtained from: FreeBSD svn revision 287886

Revision Links:
--------------
    http://svnweb.midnightbsd.org/src/?rev=287886

Modified Paths:
--------------
    trunk/sys/sys/vnode.h

Modified: trunk/sys/sys/vnode.h
===================================================================
--- trunk/sys/sys/vnode.h	2015-09-05 21:55:19 UTC (rev 7304)
+++ trunk/sys/sys/vnode.h	2015-09-17 12:46:44 UTC (rev 7305)
@@ -745,7 +745,8 @@
 
 #define	VOP_WRITE_PRE(ap)						\
 	struct vattr va;						\
-	int error, osize, ooffset, noffset;				\
+	int error;							\
+	off_t osize, ooffset, noffset;					\
 									\
 	osize = ooffset = noffset = 0;					\
 	if (!VN_KNLIST_EMPTY((ap)->a_vp)) {				\
@@ -753,7 +754,7 @@
 		if (error)						\
 			return (error);					\
 		ooffset = (ap)->a_uio->uio_offset;			\
-		osize = va.va_size;					\
+		osize = (off_t)va.va_size;					\
 	}
 
 #define VOP_WRITE_POST(ap, ret)						\



More information about the Midnightbsd-cvs mailing list