summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-07-25 02:56:17 +0000
committerbde <bde@FreeBSD.org>1999-07-25 02:56:17 +0000
commitdf4afa176b6aff7b4d5ce1f3a546f9dec80658ff (patch)
tree92bdce0def517b288e3a05147ccd5b7cbfa457b1 /sys
parent13dd3005e32d05513787ea6d16f327ec6f93d0f5 (diff)
downloadFreeBSD-src-df4afa176b6aff7b4d5ce1f3a546f9dec80658ff.zip
FreeBSD-src-df4afa176b6aff7b4d5ce1f3a546f9dec80658ff.tar.gz
Don't set IN_ACCESS for requests to read 0 bytes or for unsuccessful reads.
Translated from: similar fixes in ufs_readwrite.c rev.1.61. Things are simpler (but annoyingly different) here because there are no vm optimisations.
Diffstat (limited to 'sys')
-rw-r--r--sys/gnu/ext2fs/ext2_readwrite.c6
-rw-r--r--sys/gnu/fs/ext2fs/ext2_readwrite.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/gnu/ext2fs/ext2_readwrite.c b/sys/gnu/ext2fs/ext2_readwrite.c
index d5881e2..abcdfe3 100644
--- a/sys/gnu/ext2fs/ext2_readwrite.c
+++ b/sys/gnu/ext2fs/ext2_readwrite.c
@@ -68,7 +68,7 @@ READ(ap)
daddr_t lbn, nextlbn;
off_t bytesinfile;
long size, xfersize, blkoffset;
- int error;
+ int error, orig_resid;
u_short mode;
vp = ap->a_vp;
@@ -92,6 +92,7 @@ READ(ap)
return (EFBIG);
#endif
+ orig_resid = uio->uio_resid;
for (error = 0, bp = NULL; uio->uio_resid > 0; bp = NULL) {
if ((bytesinfile = ip->i_size - uio->uio_offset) <= 0)
break;
@@ -147,7 +148,8 @@ READ(ap)
}
if (bp != NULL)
bqrelse(bp);
- if (!(vp->v_mount->mnt_flag & MNT_NOATIME))
+ if (orig_resid > 0 && (error == 0 || uio->uio_resid != orig_resid) &&
+ (vp->v_mount->mnt_flag & MNT_NOATIME) == 0)
ip->i_flag |= IN_ACCESS;
return (error);
}
diff --git a/sys/gnu/fs/ext2fs/ext2_readwrite.c b/sys/gnu/fs/ext2fs/ext2_readwrite.c
index d5881e2..abcdfe3 100644
--- a/sys/gnu/fs/ext2fs/ext2_readwrite.c
+++ b/sys/gnu/fs/ext2fs/ext2_readwrite.c
@@ -68,7 +68,7 @@ READ(ap)
daddr_t lbn, nextlbn;
off_t bytesinfile;
long size, xfersize, blkoffset;
- int error;
+ int error, orig_resid;
u_short mode;
vp = ap->a_vp;
@@ -92,6 +92,7 @@ READ(ap)
return (EFBIG);
#endif
+ orig_resid = uio->uio_resid;
for (error = 0, bp = NULL; uio->uio_resid > 0; bp = NULL) {
if ((bytesinfile = ip->i_size - uio->uio_offset) <= 0)
break;
@@ -147,7 +148,8 @@ READ(ap)
}
if (bp != NULL)
bqrelse(bp);
- if (!(vp->v_mount->mnt_flag & MNT_NOATIME))
+ if (orig_resid > 0 && (error == 0 || uio->uio_resid != orig_resid) &&
+ (vp->v_mount->mnt_flag & MNT_NOATIME) == 0)
ip->i_flag |= IN_ACCESS;
return (error);
}
OpenPOWER on IntegriCloud