Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet Fix problem where vnode vp_size was not ...



details:   https://anonhg.NetBSD.org/src/rev/191f6001ea24
branches:  trunk
changeset: 760142:191f6001ea24
user:      haad <haad%NetBSD.org@localhost>
date:      Tue Dec 28 13:36:09 2010 +0000

description:
Fix problem where vnode vp_size was not updated when vndoe was already allocated,
for vdev. This makes ztest survive ztest_vdev_LUN_growth test. Replace dummy
VOP_GETATTR with vn_getattr routine which reset vp_size and vattr_size accordingly
to reality.

diffstat:

 external/cddl/osnet/lib/libzpool/kernel.c |  22 ++++++++++++++++++++--
 external/cddl/osnet/sys/sys/zfs_context.h |   4 ++--
 2 files changed, 22 insertions(+), 4 deletions(-)

diffs (61 lines):

diff -r adb971a1c7b2 -r 191f6001ea24 external/cddl/osnet/lib/libzpool/kernel.c
--- a/external/cddl/osnet/lib/libzpool/kernel.c Tue Dec 28 12:48:38 2010 +0000
+++ b/external/cddl/osnet/lib/libzpool/kernel.c Tue Dec 28 13:36:09 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kernel.c,v 1.4 2010/05/02 23:50:34 haad Exp $  */
+/*     $NetBSD: kernel.c,v 1.5 2010/12/28 13:36:09 haad Exp $  */
 
 /*
  * CDDL HEADER START
@@ -29,7 +29,7 @@
 #pragma ident  "%Z%%M% %I%     %E% SMI"
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: kernel.c,v 1.4 2010/05/02 23:50:34 haad Exp $");
+__RCSID("$NetBSD: kernel.c,v 1.5 2010/12/28 13:36:09 haad Exp $");
 
 #include <sys/zfs_context.h>
 #include <sys/sysctl.h>
@@ -213,6 +213,24 @@
        return (ret);
 }
 
+int
+vn_getattr(vnode_t *vp, vattr_t *va)
+{
+       int fd;
+       struct stat64 st;
+
+       fd = vp->v_fd;
+
+       if (fstat64(fd, &st) == -1)
+               return (errno);
+
+       vp->v_size = st.st_size;
+       va->va_size = st.st_size;
+
+       return 0;
+}
+
+
 /*ARGSUSED*/
 int
 vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len, offset_t offset,
diff -r adb971a1c7b2 -r 191f6001ea24 external/cddl/osnet/sys/sys/zfs_context.h
--- a/external/cddl/osnet/sys/sys/zfs_context.h Tue Dec 28 12:48:38 2010 +0000
+++ b/external/cddl/osnet/sys/sys/zfs_context.h Tue Dec 28 13:36:09 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zfs_context.h,v 1.7 2010/12/14 01:23:43 haad Exp $     */
+/*     $NetBSD: zfs_context.h,v 1.8 2010/12/28 13:36:09 haad Exp $     */
 
 /*
  * CDDL HEADER START
@@ -369,7 +369,7 @@
 
 #define        VOP_CLOSE(vp, f, c, o, cr, unk) 0
 #define        VOP_PUTPAGE(vp, of, sz, fl, cr, unk)    0
-#define        VOP_GETATTR(vp, vap, fl, cr, unk) ((vap)->va_size = (vp)->v_size, 0)
+#define        VOP_GETATTR(vp, vap, fl, cr, unk) vn_getattr(vp, vap)
 #define        VOP_FSYNC(vp, f, cr, unk)       fsync((vp)->v_fd)
 
 #define        VN_RELE(vp)     vn_close(vp)



Home | Main Index | Thread Index | Old Index