Module Name:    src
Committed By:   maxv
Date:           Mon Feb 17 20:16:52 UTC 2014

Modified Files:
        src/sys/fs/tmpfs: tmpfs_vnops.c

Log Message:
Adapt my previous patch differently. read(2) wants EISDIR when the
object is a directory. Which also means that tmpfs_read() was returning
a wrong error code when dealing with non-regular vnodes.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/fs/tmpfs/tmpfs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/tmpfs/tmpfs_vnops.c
diff -u src/sys/fs/tmpfs/tmpfs_vnops.c:1.116 src/sys/fs/tmpfs/tmpfs_vnops.c:1.117
--- src/sys/fs/tmpfs/tmpfs_vnops.c:1.116	Sun Feb 16 12:54:07 2014
+++ src/sys/fs/tmpfs/tmpfs_vnops.c	Mon Feb 17 20:16:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_vnops.c,v 1.116 2014/02/16 12:54:07 maxv Exp $	*/
+/*	$NetBSD: tmpfs_vnops.c,v 1.117 2014/02/17 20:16:52 maxv Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.116 2014/02/16 12:54:07 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.117 2014/02/17 20:16:52 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/dirent.h>
@@ -534,6 +534,9 @@ tmpfs_read(void *v)
 
 	KASSERT(VOP_ISLOCKED(vp));
 
+	if (vp->v_type == VDIR) {
+		return EISDIR;
+	}
 	if (uio->uio_offset < 0 || vp->v_type != VREG) {
 		return EINVAL;
 	}

Reply via email to