Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/tmpfs tmpfs_read: handle requests past EOF.



details:   https://anonhg.NetBSD.org/src/rev/154b9fa35417
branches:  trunk
changeset: 584357:154b9fa35417
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Sep 14 10:40:49 2005 +0000

description:
tmpfs_read: handle requests past EOF.

diffstat:

 sys/fs/tmpfs/tmpfs_vnops.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 2378f36fe664 -r 154b9fa35417 sys/fs/tmpfs/tmpfs_vnops.c
--- a/sys/fs/tmpfs/tmpfs_vnops.c        Wed Sep 14 10:33:25 2005 +0000
+++ b/sys/fs/tmpfs/tmpfs_vnops.c        Wed Sep 14 10:40:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmpfs_vnops.c,v 1.7 2005/09/13 20:02:05 jmmv Exp $     */
+/*     $NetBSD: tmpfs_vnops.c,v 1.8 2005/09/14 10:40:49 yamt Exp $     */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.7 2005/09/13 20:02:05 jmmv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.8 2005/09/14 10:40:49 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/dirent.h>
@@ -544,6 +544,9 @@
                vsize_t len;
                void *win;
 
+               if (node->tn_size <= uio->uio_offset)
+                       break;
+
                len = MIN(node->tn_size - uio->uio_offset, uio->uio_resid);
                if (len == 0)
                        break;



Home | Main Index | Thread Index | Old Index