From: Miklos S. <mi...@sz...> - 2011-10-21 11:50:49
|
lu...@gn... (Ludovic Courtès) writes: > I run the attached script from the SSHFS mount point of localhost:. > Two remarks: > > 1. The script fails to reproduce the problem when using cmp(1) to > compare the original file and the SSHFS-mounted one. It turns out > that cmp(1) uses 4 KiB reads. > > 2. The script reproduces the problem with files around 160 KiB when > using sha1sum(1), which uses 32 KiB reads. > >> Please send a debug output of sshfs: >> >> sshfs -odebug,sshfs_debug,loglevel=debug ... > > Output attached for two runs of sha1sum on a 163 KiB file. Thanks. Problem seems to be that the kernel is requesting 64k reads but the sftp-server is only providing 32k reads. Short reads are taken by the kernel to indicate EOF. To work around this, try "-omax_read=32768" option. Not sure what the best permanent solution is. sshfs could validate short reads by resending the read request for the remaining buffer, but that seems unnecessary in most cases. Or it could resend only if there's more to read according to the cached file size. Thanks, Miklos |