Commit Graph

279 Commits

Author SHA1 Message Date
njoly
4c9ac951c7 Fix a crash while trying to read nodes on amd64, reported in PR/41494,
by not doing any transfert when offset exceed the actual data length.

From and ok by pooka@.
2009-05-28 10:07:06 +00:00
pooka
d6c25c2b9b wait() for dead ssh processes (but don't block, so we might have
one teeny zmobie in the system).
2009-05-20 15:04:36 +00:00
pooka
b5cb6a6ca0 Fix SNAFU in previous: connection handshake is already handled by
the connect routine now, so we're not required/allowed to do it twice.
Makes reconnect on dead link work again.
2009-05-20 14:39:42 +00:00
pooka
dac06153a9 Copyright year management. no functional change (unless sarah disagrees) 2009-05-20 14:08:21 +00:00
pooka
8ff915319e Introduce -c [12], which can be used to open 1 or 2 ssh connections
to the server.  If "2" is specified, a separate connection is used
for data and directory operations.  Using two connections can
significantly increase directory operation performance on a saturated
link, at least up to 30x faster.
2009-05-20 13:56:36 +00:00
pooka
45ef580f17 Merge librumpfs_ufs into librumpfs_ffs. This reflects what happened
with the ffs kernel module and follows the trend of retiring ufs.
It also allows to get rid of a special case kludge in runtime module
loading, since ufs was not really a module.  librumpfs_ufs is now
obsoleted and ffs consumers should be linked solely against
librumpfs_ffs.
2009-05-02 01:15:52 +00:00
lukem
d877c4c3c0 Enable WARNS=4 by default, except for:
cpuctl  dumplfs  hprop  ipf  iprop-log  kadmin  kcm  kdc  kdigest
	kimpersonate  kstash  ktutil  makefs  ndbootd  ntp  pppd  quot
	racoon  racoonctl  rtadvd  sntp  sup  tcpdchk  tcpdmatch  tcpdump
	traceroute  traceroute6  user  veriexecgen  wsmoused  zic
(Mostly third-party applications)
2009-04-22 15:23:01 +00:00
pooka
73871be1ed fix WARNS=4, recipe from lukem 2009-04-15 08:36:21 +00:00
pooka
d3739e6172 Save errno before descending to cleanup gehennom. 2009-03-29 16:06:53 +00:00
pooka
61260da885 In case the portal provider fails, do not try to pass an
uninitialized fd value.  Also, propagate errno to the caller.
2009-03-18 09:10:16 +00:00
wiz
2dba01f8d6 Make "sftp" a link. 2009-02-26 07:14:36 +00:00
pooka
928c35bfce add caveat about info displayed by df(1) 2009-02-25 18:05:32 +00:00
pooka
72d8b8b617 Support statvfs@openssh.com extension where available. Makes df(1)
return something other than just 0.
caveat: statvfs is done for the mountpoint path, so might not give
the truth about a directory inside the mountpoint.
2009-02-23 18:43:46 +00:00
pooka
501138e80e regen: putter in synopsis and note about experimental status 2009-02-15 18:01:26 +00:00
pooka
0838b02036 * include "pseudo-device putter" in synopsis as requested by hubertf
* note that rump p2k utilities are currently experimental (noted
  already on the rump manpages, but better note it here also)
2009-02-15 18:00:16 +00:00
pooka
1ca3ac22a3 regen: note that vnconfig not required 2009-02-10 15:08:40 +00:00
pooka
108fcd8ae3 Note that the rump file servers do not require use of vnconfig when
mounting images.  Suggested by apb
2009-02-10 15:04:35 +00:00
he
fddc3457b2 Change the use of formally undocumented features, which have now been
made to fail.  Specifically, change
.ifdef(SYMBOL) -> .ifdef SYMBOL or .if defined(SYMBOL),
and corresponding for .ifndef.

Also correct one error in lib/libm/Makefile (.ifdef (${MKCOMPLEX} != "no")?!?).
2009-01-18 20:42:11 +00:00
lukem
3cafe960ea fix -Wsign-compare issues 2009-01-18 10:10:47 +00:00
pooka
f604838fff Remove -I${NETBSDSRCDIR}/sys. I have no idea why it was there, but
it sure creates some interesting side-effects.
2009-01-12 20:43:29 +00:00
wiz
140f24c96f regen. 2009-01-11 22:03:15 +00:00
wiz
9492e5b9bf Make ready for HTML output, add comma. 2009-01-11 22:03:10 +00:00
wiz
eaae165147 Mark up arguments with Ar and drop trailing whitespace. 2009-01-11 22:02:38 +00:00
pooka
317dcf1496 regen: mount -o rump 2009-01-11 21:15:31 +00:00
pooka
4c643b2022 Note mount -o rump support. 2009-01-11 21:15:07 +00:00
pooka
bbf08a8acb Default to threading, non-threaded debug mode can be compiled separately.
Useful if running this from fstab.
2009-01-11 20:31:03 +00:00
pooka
29d7878897 Don't compile diagnostic code which accesses kernel symbols directly.
Will fail now since not all archs have the same symbol names.
2009-01-10 20:21:15 +00:00
pooka
73cbbc614e For applications which naughtily reach over to the rump kernel
namespace without using proper interfaces, do a little namespace
compensation.
2009-01-08 18:44:31 +00:00
pooka
e39b6ca29f Disable static linking against kernel modules and always use shared
libraries.  Kernel module support will require some more happy days
with the kernel linker.
2009-01-08 18:43:28 +00:00
pooka
a378ac816b Put syspuffs_glueinit in the rump kernel namespace. 2009-01-08 03:27:10 +00:00
pooka
4e41c02e05 malloc(9) -> kern_malloc(9): we don't need --wrap anymore. 2009-01-05 21:45:35 +00:00
pooka
1bc460cc53 use kernel module 2009-01-05 15:39:34 +00:00
pooka
84ff1461c4 Track parent directory in cross-directory renames so that mv & rm
for the same file during a vnode's lifecycle works.

... rename fix .. it's going to be a good year ...
2009-01-01 13:41:45 +00:00
pooka
1d6d3e2769 Link self-contained file systems (i.e. do not depend on other file
systems) against the kernel module on select archs.
2008-12-30 22:20:56 +00:00
pooka
de62974531 Do some nasty manual tricks and treats to avoid having to call
rump_init() here (creating threads before we ask p2k to detach from
console is bad).
2008-12-12 19:59:00 +00:00
pooka
6459cc14b9 Dynamically load ext2 support, since the linker can't handle more
that one file system module (ext2fs uses both ffs and itself).
2008-11-26 19:41:11 +00:00
pooka
762d8bce6b Try to honor rump_threads by not creating iothreads if threads are off. 2008-11-26 07:20:22 +00:00
pooka
e10fef6cd2 Split vfs out of rumpkern into rumpvfs. Non-fs rumps no longer
include the file system code.  File system rumps explicitly need
to include rumpvfs from now on.
2008-11-19 14:10:48 +00:00
pooka
de3f0274f6 Don't set PUFFS_FLAG_OPDUMP by default. 2008-11-14 13:45:25 +00:00
pooka
a162d50c30 regen 2008-10-16 10:32:28 +00:00
pooka
44bb67c4bb Be more verbose about the performance hit. 2008-10-16 10:30:17 +00:00
pooka
d72ee403e1 Add & enable rump_nfs. 2008-10-16 09:30:57 +00:00
pooka
f4ce96e86b check rump_init() return value 2008-10-07 23:22:05 +00:00
christos
fc978808f9 fix more A0 2008-09-12 14:40:46 +00:00
pooka
f423bfeed2 Due to a recent encounter with a sucky internet connection, add
experimental option -p, which tries to reestablish the connection
to the sftp server in case it is lost.  This currently has a few
limitations (found in the man page), but generally works in some
use cases.

Better support might eventually emerge, but since that requires a
plunge into the depths of puffs_framebuf, I need quite a bit of
Fernet Branca to build up my courage before attempting it.
2008-09-06 12:29:57 +00:00
wiz
73d262db0f regen 2008-09-05 09:07:47 +00:00
wiz
0dd18a1929 Fix weird character problem at the source. 2008-09-05 09:07:40 +00:00
wiz
4d6d134c99 Remove weird character. 2008-09-05 09:00:01 +00:00
pooka
660c5d7442 forgot to commit this - descend into rump_sysvbfs 2008-09-04 16:16:32 +00:00
pooka
7925afe7fc Use mntflags handed to us by parseargs() instead of hardcoded MNT_RDONLY. 2008-09-04 15:38:34 +00:00
pooka
7c5de9872e Use the standard practice of canon_dev/dir instead of argv[optind] 2008-09-04 15:35:58 +00:00
pooka
d559e45903 adjust copyright to match reality. no functional change. 2008-09-04 15:34:55 +00:00
pooka
795cda8d6a Add rump support for sysvbfs. 2008-09-04 12:21:25 +00:00
pooka
183cac798d add file missed in previous commit 2008-09-02 21:14:32 +00:00
pooka
827e91dd6f Make syspuffs mount code supply mount_syspuffs_parseargs() like
the other mount binaries do.  Now syspuffs can be used to run all
puffs file systems as utilities.  This includes fuse file systems
and becomes interesting with the fs-utils project.  We can now do
e.g. this:

  ReFUSE ntfs-3g:
golem> echo hello | fsu_write/fsu_write ntfs-3g puffs ~/img/ntfs.img dafile
golem> fsu_cat/fsu_cat ntfs-3g puffs ~/img/ntfs.img dafile
hello
golem>

  puffs sysctlfs:
golem> fsu_ls/fsu_ls mount_sysctlfs puffs sysctl -l ddb
total 0
-r-xr-xr-x  1 pooka  users  1 Sep  2 22:11 commandonenter
-r-xr-xr-x  1 pooka  users  2 Sep  2 22:11 fromconsole
-r-xr-xr-x  1 pooka  users  3 Sep  2 22:11 lines
-r-xr-xr-x  1 pooka  users  8 Sep  2 22:11 maxoff
-r-xr-xr-x  1 pooka  users  3 Sep  2 22:11 maxwidth
-r-xr-xr-x  1 pooka  users  2 Sep  2 22:11 onpanic
-r-xr-xr-x  1 pooka  users  3 Sep  2 22:11 radix
-r-xr-xr-x  1 pooka  users  2 Sep  2 22:11 tabstops
-r-xr-xr-x  1 pooka  users  2 Sep  2 22:11 tee_msgbuf

Same works for psshfs etcetc.

In other words, this provides total integration for "normal"
in-kernel file systems and puffs/fuse file systems on the ukfs
library level.

Note: implementation is still "first stab" and the fs-utils usage
will no doubt change.
2008-09-02 19:38:25 +00:00
pooka
e8a1f963a5 fix tyop in error message, no functional change 2008-08-24 18:26:05 +00:00
pooka
30c29b1b53 * Apparently u9fs returns the inode number as the unique qidpath.
This is fairly annoying if browsing a hierarchy with multiple file
  systems mounted, since at least inode 2 is fairly common.  Compensate
  by comparing modification time also.  Not perfect, but ....
* Don't loop eternally if we attempt to read at or past EOF.  Fixes
  reading files on a non-cached mount.
2008-08-22 17:44:14 +00:00
pooka
3fd391abc8 void * -> puffs_cookie_t
no functional change
2008-08-12 19:51:55 +00:00
pooka
84c098fe27 call puffs_exit() 2008-08-11 16:23:58 +00:00
pooka
716a1797f9 We can actually simply use execvp() instead of /bin/sh for
exec-and-pathsearch-with-environ.
Thanks to bad for pointing this out & apb + blymn for some discussion.
2008-08-11 13:32:55 +00:00
pooka
5f1dda08e4 add manpage for rump_syspuffs 2008-08-09 11:07:26 +00:00
pooka
69b613ef54 exec file server via sh -c to get the benefit of PATH search. 2008-08-08 16:59:02 +00:00
pooka
0128ff2d3e add comment stating that the manpage is generated 2008-08-06 20:18:19 +00:00
pooka
79e4f54e20 add simple utility for autogenerating rump man pages 2008-08-06 20:15:30 +00:00
pooka
2c6e40dafe Add manual pages for rump file system servers. 2008-08-06 20:14:08 +00:00
pooka
99fed7264c Refactor mount utilities to provide a mount_fs_parseargs() routine.
Use this routine both in mount_fs and rump_fs to provide equivalent
command line parameters and therefore usage interchangeability.
While doing this, combine some common mountgoop to mountprog.h
2008-08-05 20:57:45 +00:00
pooka
dd569b0633 Use command line option parsing code from sbin/mount_msdos to
gain equal usage and behaviour with the "real" counterpart.
2008-07-29 16:06:18 +00:00
pooka
bdf6e0b034 Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
  * install relevant headers into /usr/include/rump
  * build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
    from src/lib and install as librumpuser and librump, respectively
    + this retains the ability to test a librump build with just the
      kernel sources at hand
  * move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
    for general consumption, they are not kernel-space dwellers anyway
  * build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
  * add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
  * build and install userspace kernel file system daemons if MKPUFFS=yes
    is spexified
  * retire fsconsole for now, it will make a comeback with an actually
    implemented version shortly
2008-07-29 13:17:40 +00:00
jmmv
d96be1e18a Add a -F option to allow passing a configuration file to ssh(1), instead
of having to use multiple -O options on the command line.  OKed by pooka@.
2007-12-14 10:56:22 +00:00
pooka
074f023a65 Record inode number in psshfs_dir also for already instantiated
nodes when doing readdir.  This makes pwd work again for cases
where getcwd() actually has to do the "READDIR + compare inode
numbers" trick.

Yet another problem reported by jmmv.
2007-12-13 14:59:00 +00:00
pooka
343d277986 *blink*, remember to update comment too 2007-12-13 14:32:47 +00:00
pooka
794adab583 Do previous in a way which causes less waste of potential inode numbers. 2007-12-13 14:31:44 +00:00
pooka
00b48f3e40 Fix lossage noticed by jmmv (mostly for -t 0 mounts) and make sure
a node always has the inode number set.  And since I'm feeling
generous, sprinkle a few comments around the affected areas (mostly
so that I'd remember what in the world the code is trying to do).
2007-12-12 16:04:35 +00:00
pooka
faa30930fd When creating a node, do the server-dance before creating the local
data structure.  This avoids a race between create and lookup, as
the kernel now unlock the directory before the create operation
returns.
2007-12-09 18:05:42 +00:00
pooka
a86a009392 Don't use puffs_cc_getusermount() 2007-12-07 14:59:22 +00:00
pooka
f845b0dacb Get rid of a lot of extra complexity due to doing separate getattr
requests in readdir - just use the results from the readdir rpc.
2007-12-07 14:54:08 +00:00
pooka
2195151d14 In case a node is created in lookup in the readdir path, initialize
attribute cache timestamp to be equal to that of the directory
cache timestamp.
2007-12-07 13:09:49 +00:00
pooka
375257e2a7 Invalidate namecache for a directory only if we've already read it
at least once.
2007-12-05 12:01:44 +00:00
pooka
30e5c41557 When scheduling waiters for re-run, remove them from the waitqueue
already when scheduling to make sure they're not scheduled more
than once.
2007-12-04 19:31:22 +00:00
wiz
6ee13c8582 Do not overload Xr macro. 2007-12-03 18:14:48 +00:00
wiz
9fbc5e2b76 Sort options. 2007-12-02 21:03:39 +00:00
wiz
c50e337e51 Nits. Sort options. 2007-12-02 21:03:32 +00:00
wiz
c3ff82973e Sort SEE ALSO. Minor nit fixes. 2007-12-02 19:05:51 +00:00
pooka
21913eabe5 Rototill.
Ok, ok, a few more words about it: stop holding puffs_cc as a holy
value and passing it around to almost every possible place (popquiz:
which kernel variable does this remind you of?).  Instead, pass
the natural choice, puffs_usermount, and fetch puffs_cc via
puffs_cc_getcc() only in routines which actually need it.  This
not only simplifies code, but (thanks to the introduction of
puffs_cc_getcc()) enables constructs which weren't previously sanely
possible, say layering as a curious example.

There's still a little to do on this front, but this was the major
fs interface blast.
2007-11-30 19:02:28 +00:00
pooka
3fe3f65454 Introduce the concept of lazyopens. This means that when a file
handle open is requested, it is waited for only if the node was
not previously succesfully opened.  The actual wait for the file
handle happens only when the file handle is actually needed (read
or write).  This in turn has the effect that reading cached files
will be quick instead of waiting for the file handle from the sftp
server first.  The wait previously could be very long if there were
serveral hundred k of outstanding requests in a limited-bandwidth
link.

The code is in some need of serious handholding, but it works, so
I'll leave that as "future work".
2007-11-30 16:24:04 +00:00
pooka
6a3d9a187d Remove "puffs_cid" from the puffs interface following l-removal
from the kernel vfs interfaces.  puffs_cc_getcaller(pcc) can be
used now should the same information be desired.
2007-11-27 11:31:17 +00:00
pooka
8dd9b67755 Don't bother tracking opencount and try to close file handles in
the close method - simply just wait for inactive and do it there.
2007-11-18 17:41:55 +00:00
pooka
4462e9454f use puffs_daemon() instead of daemon() 2007-11-16 18:39:01 +00:00
pooka
968196af71 If a regular file was remotely updated and a readdir was done on
the directory which contained the file before a getattr on the file
itself, the locally cached mtime would be updated without invalidating
the kernel page cache.  Thus incorrect data would be returned when
the node was read afterwards as the node size wouldn't match the
data length in the page cache.

Fix the problem by making all vattr-setting routines use the same code.

Problem noticed again by jmmv & atf (and again by running atf over
psshfs ... sometimes you're the windshield, sometimes you're the bug)
2007-11-16 15:53:47 +00:00
jmmv
55876f3f39 Drop trailing whitespace. On behalf of pooka. 2007-11-16 15:10:06 +00:00
pooka
0feebae56b When checking if the file page cache should be invalidated, compare
against cached mtime instead of attrread - attrread can be reset
these days by sending SIGHUP.

Problem noticed by jmmv & atf (well.. namely by using atf through psshfs).
2007-11-16 14:25:47 +00:00
pooka
b0106b7eaf Don't overload "attributes last read" for the symlink cache,
use a separate variable.
2007-11-11 18:06:35 +00:00
pooka
6b4d0688e7 Cache readlink results similarly to attributes. Makes "cd" fast
for a slow connection if a symlink is along the path.

(this should be done elsewhere, but I want it for sshfs now)
2007-11-10 18:36:06 +00:00
pooka
c5afd8dc36 Make it possible to force attribute/directory cache re-read by
sending SIGHUP to mount_psshfs.
2007-11-08 17:49:43 +00:00
pooka
7dc67449bf don't allow negative timeouts apart from -1 2007-11-08 16:42:31 +00:00
pooka
a56f46a5ac Make attribute & directory content caching timeout a command line
option.  Use -t -1 to never expire, which is nifty on a high-latency
link where you know the server won't be modified from under you.
2007-11-08 16:40:14 +00:00
pooka
a02fe51bef Open the kernel descriptor as part of mount(), not init(). Then
it doesn't matter if someone fork()s or does other tricks between
init() and mount() (and besides, now it's where it logically should be).
2007-11-06 15:09:07 +00:00
pooka
ec865a5b29 Actually, daemonize the file servers before mounting. I might require
at some point that the local protocol handler does not change after
the file system has been mounted.
2007-11-05 17:54:31 +00:00
pooka
4b0f2948e2 Pull the daemonizing code out of the library mainloop into the file
servers.  Calling daemon() (i.e. fork()ing) inside a library can
cause nice surprises for e.g. threaded programs.  As discussed with
Greg Oster & others.
2007-11-05 17:48:17 +00:00
pooka
afe4c2ed02 Use puffs_cc_schedule() (which is an exported interface) instead of
plugging directly to puffs_goto().
2007-10-21 19:27:12 +00:00