Commit Graph

161 Commits

Author SHA1 Message Date
szptvlfn 20e418f0d1 s/stavfs/statvfs/ 2014-06-25 23:22:18 +00:00
reed 71cb89f544 fix spelling typo 2012-12-25 20:31:03 +00:00
christos 4f048a363d include the headers you use 2012-11-04 22:46:08 +00:00
jakllsch c53184c92c Ensure psshfs_node_read() completely reads all data before return.
Fixes file corruption in psshfs exposed with kernel MAXPHYS at 128KiB.
2012-01-20 22:07:58 +00:00
wiz 5f13296f84 Wording, from Snader_LB. 2011-09-15 11:52:09 +00:00
joerg bec77c5f43 Use __dead 2011-08-31 13:32:36 +00:00
jakllsch 3c644b8a5a Bring mount_psshfs user/host/path argument processing in line with sftp(1). 2011-08-25 19:49:05 +00:00
riastradh 772f45cfc9 Cache vattr in psshfs's setattr.
This means within the cache window, a setattr that wouldn't change the
remote file's attributes from our current view of them will not be
relayed to the server and wait for the server to answer.  Thus, e.g., a
process with a periodic timer interrupt that calls open(2) in a loop
can make progress with much higher probability than without caching.

XXX The test case doesn't work, so it's currently disabled.  It needs
to stop the child of sshd that is handling an sftp session, not sshd
itself, and it's not obvious how to do that.

ok pooka
2011-08-12 04:14:00 +00:00
mrg 33c01d32fc remove some always true if () checks GCC 4.5.3 picks up. 2011-06-22 04:03:23 +00:00
riastradh f4368f5168 Initialize psshfs root node's readdir waiters queue.
Every other node's readder waiters queue is initialized in makenode,
but the root node is created specially.

ok pooka
2011-05-19 15:07:16 +00:00
pooka 080506bc5d Make error message more userfriendly in cases where server does
not support sftp.
2010-10-29 16:13:51 +00:00
pooka 326638b53f In case we create a file, reclaim the vnode, and lookup the file
without the directory timeout expiring, we get vattr_null as the
attributes for that file.  Ensure that we always report sane
attributes by getting them from the server if this is the case.
(also, sprinkle some const)

Fixes problem reported by dyoung.   But wait!  The bug's medallion
begins to glow!  The bug looks much better!  I crumble to dust.

There's probably another similar bug related to "lazy open".  It
will trigger if we reclaim a node before the response to the open
arrives.  Even the comments (typoless) know about this bug ...
But verifying it exists and fixing it will have to wait for another
day.
2010-04-01 02:34:09 +00:00
pooka d317936de6 umgah. meant fts, not fsu 2010-02-17 15:54:10 +00:00
pooka 046f5845a2 Bump the initial rootdir link count guess to a ludicrous value. 2010-02-17 15:50:54 +00:00
pooka 73655f9fb0 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.
2010-02-17 15:47:36 +00:00
pooka 70b8adf303 Give credit: psshfs was inspired by FUSE sshfs. 2010-02-03 17:16:29 +00:00
pooka 7face90494 statvfs:
Since bresvd is not available from the server, calculate:
	bresvd = bfree - bavail.

Then df calculates:
	bavail = bfree - bresvd;

And we now get a much more accurate report from df on how much one
can write to the fs.
2010-02-03 17:02:52 +00:00
pooka ef38ca9933 Make r/w servers unmount themselves cleanly upon receiving SIGINT/TERM. 2010-01-12 18:43:37 +00:00
pooka e828ea6b56 Fix compilation with -Wsign-compare. Apparently 5.0 doesn't have
-Wsign-compare enabled, which explains a thing or two ...

pointed out by gson
2010-01-08 10:53:31 +00:00
wiz a9e00b2097 Don't be terse. 2010-01-07 23:35:45 +00:00
pooka eac396bb5a errx() already contains progname ... 2010-01-07 21:26:49 +00:00
pooka 754f939dd3 Don't allow mangling of uid or gid -1, since they have a special
meaning in the sftp protocol.
2010-01-07 21:23:10 +00:00
pooka 6cd252da60 Fix chgrp (and don't rely on VNOVAL being -1, however unlikely that
is to be broken).
2010-01-07 21:19:45 +00:00
pooka c4291c195a Add -u and -g, which allow to remap one (local,remote) uidgid, i.e.
umapfs without the fuss.
2010-01-07 21:05:50 +00:00
pooka 5866121c7c more lp64 it's-a-sign! fixes 2009-11-05 13:28:18 +00:00
pooka de048bdaae const woes 2009-11-05 11:40:24 +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
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 d3739e6172 Save errno before descending to cleanup gehennom. 2009-03-29 16:06:53 +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 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 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
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
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