aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPercy Jahn <email@percyjahn.de>2011-08-24 13:22:36 +0200
committerMiklos Szeredi <mszeredi@suse.cz>2011-08-24 13:22:36 +0200
commit19cb995c2353f920a893057f54e02be772f42843 (patch)
treeed2a636724936e69da772d8a545d4a646e657c4e
parent49203ee923b2dcc8d4fd65c61b076e357c5e224d (diff)
downloadsshfs-19cb995c2353f920a893057f54e02be772f42843.tar
sshfs-19cb995c2353f920a893057f54e02be772f42843.tar.gz
sshfs-19cb995c2353f920a893057f54e02be772f42843.tar.bz2
sshfs-19cb995c2353f920a893057f54e02be772f42843.zip
sshfs: fstat workaround
Add "-oworkaround=fstat" for SFTP servers which don't support the FSTAT message.
-rw-r--r--ChangeLog5
-rw-r--r--sshfs.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 30a7cbf..fb3088f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-24 Miklos Szeredi <miklos@szeredi.hu>
+
+ * Add "-oworkaround=fstat" for SFTP servers which don't support
+ the FSTAT message. Patch by: Percy Jahn
+
2011-07-01 Miklos Szeredi <miklos@szeredi.hu>
* Released 2.3
diff --git a/sshfs.c b/sshfs.c
index 22bda6b..64a5eb6 100644
--- a/sshfs.c
+++ b/sshfs.c
@@ -180,6 +180,7 @@ struct sshfs {
int nodelaysrv_workaround;
int truncate_workaround;
int buflimit_workaround;
+ int fstat_workaround;
int transform_symlinks;
int follow_symlinks;
int no_check_root;
@@ -334,11 +335,13 @@ static struct fuse_opt workaround_opts[] = {
SSHFS_OPT("none", nodelaysrv_workaround, 0),
SSHFS_OPT("none", truncate_workaround, 0),
SSHFS_OPT("none", buflimit_workaround, 0),
+ SSHFS_OPT("none", fstat_workaround, 0),
SSHFS_OPT("all", rename_workaround, 1),
SSHFS_OPT("all", nodelay_workaround, 1),
SSHFS_OPT("all", nodelaysrv_workaround, 1),
SSHFS_OPT("all", truncate_workaround, 1),
SSHFS_OPT("all", buflimit_workaround, 1),
+ SSHFS_OPT("all", fstat_workaround, 1),
SSHFS_OPT("rename", rename_workaround, 1),
SSHFS_OPT("norename", rename_workaround, 0),
SSHFS_OPT("nodelay", nodelay_workaround, 1),
@@ -349,6 +352,8 @@ static struct fuse_opt workaround_opts[] = {
SSHFS_OPT("notruncate", truncate_workaround, 0),
SSHFS_OPT("buflimit", buflimit_workaround, 1),
SSHFS_OPT("nobuflimit", buflimit_workaround, 0),
+ SSHFS_OPT("fstat", fstat_workaround, 1),
+ SSHFS_OPT("nofstat", fstat_workaround, 0),
FUSE_OPT_END
};
@@ -2693,6 +2698,9 @@ static int sshfs_fgetattr(const char *path, struct stat *stbuf,
if (!sshfs_file_is_conn(sf))
return -EIO;
+ if (sshfs.fstat_workaround)
+ return sshfs_getattr(path, stbuf);
+
buf_init(&buf, 0);
buf_add_buf(&buf, &sf->handle);
err = sftp_request(SSH_FXP_FSTAT, &buf, SSH_FXP_ATTRS, &outbuf);