Zero-byte files with 0.32

Assar Westerlund assar at stacken.kth.se
Fri Mar 31 19:24:11 CEST 2000


sperber at informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor]) writes:
> I still sometimes see zero-byte files with arla 0.32 on FreeBSD
> 4.0-RELEASE:  stat() says the file has 0 bytes, but once I actually
> open and read it, the file is there, and the stat() count is
> adjustable.  I have one fairly elaborate way of reliably reproducing
> the problem.  Any suggestions how I should debug it?

Can you before debugging it try this patch and see if that solves your
problem?  Thanks.

/assar

Index: xfs_vnodeops-common.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/bsd/xfs_vnodeops-common.c,v
retrieving revision 1.51
retrieving revision 1.53
diff -u -w -r1.51 -r1.53
--- xfs_vnodeops-common.c	2000/03/19 03:57:47	1.51
+++ xfs_vnodeops-common.c	2000/03/25 13:41:18	1.53
@@ -381,6 +381,16 @@
 	}
 	msg.handle = xn->handle;
 	vattr2xfs_attr(vap, &msg.attr);
+	if (vp->v_type == VREG) {
+	    if (vap->va_size != (u_quad_t)VNOVAL)
+		XA_SET_SIZE(&msg.attr, vap->va_size);
+	    else
+		XA_SET_SIZE(&msg.attr, xn->attr.va_size);
+	}
+	if (vap->va_mtime.tv_sec != (unsigned int)VNOVAL)
+	    XA_SET_MTIME(&msg.attr, vap->va_mtime.tv_sec);
+	else
+	    XA_SET_MTIME(&msg.attr, xn->attr.va_mtime.tv_sec);
 
 	XFS_TOKEN_CLEAR(xn, XFS_ATTR_VALID, XFS_ATTR_MASK);
 	error = xfs_message_rpc(xfsp->fd, &msg.header, sizeof(msg));





More information about the Arla-drinkers mailing list