Date: Thu, 18 Feb 1999 06:30:01 -0800 (PST) From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs@FreeBSD.org Subject: Re: misc/10148: atime behavior differs with empty files for 2.2.8 and 3.1-current Message-ID: <199902181430.GAA29668@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/10148; it has been noted by GNATS. From: Bruce Evans <bde@zeta.org.au> To: freebsd-gnats-submit@FreeBSD.ORG, mvh@ix.netcom.com Cc: Subject: Re: misc/10148: atime behavior differs with empty files for 2.2.8 and 3.1-current Date: Fri, 19 Feb 1999 01:29:15 +1100 >>Description: >Create an empty file. >read the file (cat it or open with emacs) >atime is not updated for a 3.1 system, it is updated for a 2.2.8 system. >This breaks the leafnode port. >I don't know if this is due to a kernel change or a library change. >I compiled a 3.1 kernel with and without softupdates, and there >was no change, so it's not due to my using softupdates (directly, anyways). This bug was introduced in rev.1.42 of ufs_readwrite.c and hasn't been fixed, so it affects all 3.x versions. I haven't got around to committing my fix for it since the fix is tangled up with others (the atime should not be set for reads that request 0 bytes or are unsuccessful): diff -c2 ufs_readwrite.c~ ufs_readwrite.c *** ufs_readwrite.c~ Fri Jan 29 03:26:00 1999 --- ufs_readwrite.c Fri Jan 29 03:26:01 1999 *************** *** 98,108 **** return (EFBIG); - object = vp->v_object; - bytesinfile = ip->i_size - uio->uio_offset; if (bytesinfile <= 0) { ! return 0; } if (object) vm_object_reference(object); --- 102,115 ---- return (EFBIG); bytesinfile = ip->i_size - uio->uio_offset; + resid = uio->uio_resid; if (bytesinfile <= 0) { ! if (resid > 0 && !(vp->v_mount->mnt_flag & MNT_NOATIME)) ! ip->i_flag |= IN_ACCESS; ! return (0); } + error = 0; + object = vp->v_object; if (object) vm_object_reference(object); Don't apply this directly; it is tangled. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902181430.GAA29668>