> I tracked the problem down. Depending on how you look at it, it is a
> bug in openssh's sftp or in sshfs.
> 
> The problem is that when sending a file data, sshfs will just keep
> sending without waiting for the server to catch up. This does not need
> to be a problem, as the sftp server should just stop receiving TCP
> packets when the buffers are full, causing TCP resends and
> automatically slowing down the sending.
> 
> However, the openssh sftp server loop (openssh:sftp-server.c) will
> just keep trying to read from stdin. It will read from stdin to its
> input buffer at most once per loop, and dispatch at most one sftp
> packet per loop. But as each read from stdin can read up to 8 sftp
> packets into the input buffer then the input buffer risks running out
> of space. When it runs out of space then it just kills itself
> (openssh:buffer.c:buffer_append_space).
> 
> I note that the openssh sftp client has a mechanism to limit the
> number of unanswered requests, which probably means unlike sshfs, it
> is not affected.
> 
> I found that a reliable way to trigger this bug was to start a
> parallel process which hogs the disk, causing the consuming sftp
> server loop to slow down.
> -sshfs-mount localhost:/tmp test
> -ionice -c1 cp large_file /tmp/deleteme
> -dd if=/dev/zero of=test/deleteme2
> 
> The error I get is
> dd: writing to `test/deleteme2': Input/output error
> dd: closing output file `test/deleteme2': Transport endpoint is not connected
> 
> It is somewhat a matter of opinion, but I would say that it is openssh
> which should be fixed. If I look at

Great bug hunting! :)

The "Transport endpoint is not connected" error means, that sshfs
crashed, which it should not do even with a buggy sftp server.  Also
it's probably not too hard to work around this in sshfs as well.  I'll
have a look at these.

But you're right, that there's definitely something wrong with the
server as well, which should also be fixed.

Thanks,
Miklos


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to