Module Name: src
Committed By: pooka
Date: Wed Feb 17 15:47:36 UTC 2010
Modified Files:
src/usr.sbin/puffs/mount_psshfs: subr.c
Log Message:
Save "." attributes in readdir. This fixes the root link count
after readdir is called for the root dir the first time (yes,
there's still a window of wrong link count after the fs is mounted.
it's currently quite difficult to call sftp_readdir() from outside
the main loop).
Should fix "find /mnt" problem for a mountpoint with more than the
"guessed" amount of subdirectories, as reported by dyoung.
To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/puffs/mount_psshfs/subr.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/puffs/mount_psshfs/subr.c
diff -u src/usr.sbin/puffs/mount_psshfs/subr.c:1.48 src/usr.sbin/puffs/mount_psshfs/subr.c:1.49
--- src/usr.sbin/puffs/mount_psshfs/subr.c:1.48 Thu Jan 7 21:05:50 2010
+++ src/usr.sbin/puffs/mount_psshfs/subr.c Wed Feb 17 15:47:36 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: subr.c,v 1.48 2010/01/07 21:05:50 pooka Exp $ */
+/* $NetBSD: subr.c,v 1.49 2010/02/17 15:47:36 pooka Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: subr.c,v 1.48 2010/01/07 21:05:50 pooka Exp $");
+__RCSID("$NetBSD: subr.c,v 1.49 2010/02/17 15:47:36 pooka Exp $");
#endif /* !lint */
#include <assert.h>
@@ -344,6 +344,14 @@
}
free(longname);
longname = NULL;
+
+ /*
+ * In case of DOT, copy the attributes (mostly
+ * because we want the link count for the root dir).
+ */
+ if (strcmp(psn->dir[idx].entryname, ".") == 0) {
+ setpnva(pu, pn, &psn->dir[idx].va);
+ }
/*
* Check if we already have a psshfs_dir for the