Module Name: src
Committed By: pooka
Date: Tue Apr 27 13:26:13 UTC 2010
Modified Files:
src/sys/rump/librump/rumpvfs: rumpfs.c
Log Message:
Fix off-by-atleast-1 error.
Note: etfs doesn't work if rumpfs is not mounted as root. Given
that rumpfs_mount always return EOPNOTSUPP (except for mountroot),
this is not a pressible tragedy currently, but nevertheless
could/should be fixed in the future.
To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/rump/librump/rumpvfs/rumpfs.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/rump/librump/rumpvfs/rumpfs.c
diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.41 src/sys/rump/librump/rumpvfs/rumpfs.c:1.42
--- src/sys/rump/librump/rumpvfs/rumpfs.c:1.41 Mon Apr 26 23:40:22 2010
+++ src/sys/rump/librump/rumpvfs/rumpfs.c Tue Apr 27 13:26:12 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpfs.c,v 1.41 2010/04/26 23:40:22 pooka Exp $ */
+/* $NetBSD: rumpfs.c,v 1.42 2010/04/27 13:26:12 pooka Exp $ */
/*
* Copyright (c) 2009 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.41 2010/04/26 23:40:22 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.42 2010/04/27 13:26:12 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -519,8 +519,14 @@
mutex_exit(&etfs_lock);
if (found) {
+ char *offset;
+
+ offset = strstr(cnp->cn_pnbuf, et->et_key);
+ KASSERT(offset);
+
rn = et->et_rn;
- cnp->cn_consume += et->et_keylen - cnp->cn_namelen;
+ cnp->cn_consume += et->et_keylen
+ - (cnp->cn_nameptr - offset) - cnp->cn_namelen;
if (rn->rn_va.va_type != VDIR)
cnp->cn_flags &= ~REQUIREDIR;
goto getvnode;