Compare commits

..

15 Commits

Author SHA1 Message Date
Nikolaus Rath fc63c64602 Released 3.1.0 2017-08-04 15:42:38 +02:00
Nikolaus Rath 1e6e067fdf Disable writeback cache for now
Writeback cache seems to cause dataloss in some situations.
We need to investigate this first.

See https://github.com/libfuse/sshfs/issues/72.
2017-08-04 15:39:25 +02:00
Nikolaus Rath 44a56f0cac Removed unused variable. 2017-08-04 15:39:16 +02:00
Nikolaus Rath 653de120c8 Don't check st_mode of mountpoint
It is not clear what this check is supposed to achieve, and it seems to
fail in some situations (cf issue #57).

Fixes: #57.
2017-08-03 18:48:37 +02:00
Nikolaus Rath 63300fd564 Accept -o cache_* options for backward compatibility.
Fixes: #73.
2017-08-03 18:26:19 +02:00
Nikolaus Rath 45710c81d7 Travis: use alternative workaround suggested by support. 2017-07-27 21:21:46 +02:00
Nikolaus Rath 161ece55a3 Travis: disable trusty workaround
According to Travis support, this should be working now. We will see...
2017-07-27 19:15:30 +02:00
Benjamin Fleischer db149d1d87 Fall back to global I/O size on macOS
The st_blksize value of struct stat represents the optimal block size
for file I/O operations. FUSE for macOS will use this value when
preforming read or write operations on the file. The smaller st_blksize
is the more context switches are required to complete the operation.

Setting st_blksize to 0 results in FUSE for macOS falling back to the
global I/O size, that can be specified through the "-o iosize=..."
mount-time option.

Fixes osxfuse/osxfuse#389 and osxfuse/sshfs#33
2017-07-13 16:06:05 +02:00
Benjamin Fleischer 861d308a03 Don't require mount point to exists on macOS
By default volumes are mounted under /Volumes on macOS. Since macOS
10.12 the /Volumes directory is root-owned. In order to allow non-
privileged users to mount FUSE volumes under /Volumes FUSE will create
non-existent mount points automatically.

Fixes osxfuse/sshfs#27
2017-07-13 16:04:12 +02:00
Nikolaus Rath 319f0dde18 sshfs_open_commin(): fix compiler warning
wrctr cannot be used without having been initialized,
but the compiler is too dumb to see that.
2017-07-12 16:46:02 +02:00
Nikolaus Rath 82766d1093 sftp_readdir_async(): don't access request when it may have been freed
Fixes: #7
2017-07-12 16:45:17 +02:00
Nikolaus Rath 6f6491cd13 Travis: add /usr/local/lib* to ld configuration 2017-07-08 13:30:44 +02:00
Nikolaus Rath 03a693d295 Travis: install libfuse from git master 2017-07-08 13:23:18 +02:00
Nikolaus Rath 55eb1f00e6 Travis: Build libfuse with gcc-6
gcc-4.8 has trouble with libfuse 3.1.0 symbol versioning.
2017-07-08 13:14:21 +02:00
Nikolaus Rath 37b6969067 Travis: use libfuse 3.1.0 2017-07-08 12:59:20 +02:00
7 changed files with 59 additions and 32 deletions
+2 -1
View File
@@ -1,6 +1,5 @@
sudo: required
dist: trusty
group: deprecated-2017Q2
language:
- c
@@ -13,6 +12,8 @@ addons:
- clang
- gcc
- gcc-6
before_install:
- pip install pip==8.1.1 && pip3 install pip==8.1.1
install: test/travis-install.sh
script: test/travis-build.sh
+13
View File
@@ -1,3 +1,16 @@
Release 3.1.0 (2017-08-04)
--------------------------
* Temporarily disabled the writeback cache feature, since there
have been reports of dataloss when appending to files when
writeback caching is enabled.
* Fixed a crash due to a race condition when listing
directory contents.
* For improved backwards compatibility, SSHFS now also silently
accepts the old ``-o cache_*`` options.
Release 3.0.0 (2017-07-08)
--------------------------
+13
View File
@@ -586,6 +586,19 @@ static const struct fuse_opt cache_opts[] = {
clean_interval_secs), 0 },
{ "dcache_min_clean_interval=%u", offsetof(struct cache,
min_clean_interval_secs), 0 },
/* For backwards compatibility */
{ "cache_timeout=%u", offsetof(struct cache, stat_timeout_secs), 0 },
{ "cache_timeout=%u", offsetof(struct cache, dir_timeout_secs), 0 },
{ "cache_timeout=%u", offsetof(struct cache, link_timeout_secs), 0 },
{ "cache_stat_timeout=%u", offsetof(struct cache, stat_timeout_secs), 0 },
{ "cache_dir_timeout=%u", offsetof(struct cache, dir_timeout_secs), 0 },
{ "cache_link_timeout=%u", offsetof(struct cache, link_timeout_secs), 0 },
{ "cache_max_size=%u", offsetof(struct cache, max_size), 0 },
{ "cache_clean_interval=%u", offsetof(struct cache,
clean_interval_secs), 0 },
{ "cache_min_clean_interval=%u", offsetof(struct cache,
min_clean_interval_secs), 0 },
FUSE_OPT_END
};
+1 -1
View File
@@ -1,4 +1,4 @@
AC_INIT(sshfs, 3.0.0)
AC_INIT(sshfs, 3.1.0)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_CONFIG_HEADER(config.h)
+1 -1
View File
@@ -1,4 +1,4 @@
project('sshfs', 'c', version: '3.0.0',
project('sshfs', 'c', version: '3.1.0',
meson_version: '>= 0.38',
default_options: [ 'buildtype=plain' ])
+23 -26
View File
@@ -279,7 +279,6 @@ struct sshfs {
int ext_statvfs;
int ext_hardlink;
int ext_fsync;
mode_t mnt_mode;
struct fuse_operations *op;
/* statistics */
@@ -423,7 +422,13 @@ static struct fuse_opt sshfs_opts[] = {
FUSE_OPT_KEY("-p ", KEY_PORT),
FUSE_OPT_KEY("-C", KEY_COMPRESS),
FUSE_OPT_KEY("-F ", KEY_CONFIGFILE),
/* For backwards compatibility */
SSHFS_OPT("cache=yes", dir_cache, 1),
SSHFS_OPT("cache=no", dir_cache, 0),
FUSE_OPT_END
};
static struct fuse_opt workaround_opts[] = {
@@ -1644,16 +1649,11 @@ static int sftp_check_root(const char *base_path)
if (!(flags & SSH_FILEXFER_ATTR_PERMISSIONS))
goto out;
if (S_ISDIR(sshfs.mnt_mode) && !S_ISDIR(stbuf.st_mode)) {
if (!S_ISDIR(stbuf.st_mode)) {
fprintf(stderr, "%s:%s: Not a directory\n", sshfs.host,
remote_dir);
goto out;
}
if ((sshfs.mnt_mode ^ stbuf.st_mode) & S_IFMT) {
fprintf(stderr, "%s:%s: type of file differs from mountpoint\n",
sshfs.host, remote_dir);
goto out;
}
err = 0;
@@ -2073,11 +2073,16 @@ static int sftp_readdir_async(struct buffer *handle, void *buf, off_t offset,
outstanding--;
if (done) {
/* We need to cache want_reply, since processing
thread may free req right after unlock() if
want_reply == 0 */
int want_reply;
pthread_mutex_lock(&sshfs.lock);
if (sshfs_req_pending(req))
req->want_reply = 0;
want_reply = req->want_reply;
pthread_mutex_unlock(&sshfs.lock);
if (!req->want_reply)
if (!want_reply)
continue;
}
@@ -2490,7 +2495,7 @@ static int sshfs_open_common(const char *path, mode_t mode,
uint32_t pflags = 0;
struct iovec iov;
uint8_t type;
uint64_t wrctr;
uint64_t wrctr = 0;
if (sshfs.dir_cache)
wrctr = cache_get_write_ctr();
@@ -3145,6 +3150,9 @@ static int sshfs_getattr(const char *path, struct stat *stbuf,
}
if (!err) {
err = buf_get_attrs(&outbuf, stbuf, NULL);
#ifdef __APPLE__
stbuf->st_blksize = 0;
#endif
buf_free(&outbuf);
}
buf_free(&buf);
@@ -3820,9 +3828,6 @@ int main(int argc, char *argv[])
const char *sftp_server;
struct fuse *fuse;
struct fuse_session *se;
#if !defined(__CYGWIN__)
struct stat st;
#endif
#ifdef __APPLE__
if (!realpath(*exec_path, sshfs_program_path)) {
@@ -3847,7 +3852,7 @@ int main(int argc, char *argv[])
sshfs.wfd = -1;
sshfs.ptyfd = -1;
sshfs.dir_cache = 1;
sshfs.writeback_cache = 1;
sshfs.writeback_cache = 0;
sshfs.show_help = 0;
sshfs.show_version = 0;
sshfs.singlethread = 0;
@@ -3895,7 +3900,11 @@ int main(int argc, char *argv[])
fprintf(stderr, "see `%s -h' for usage\n", argv[0]);
exit(1);
}
if(sshfs.writeback_cache)
printf("NOTICE: writeback cache is disabled in this release due to potential\n"
"dataloss. It will be re-enabled in a future SSHFS release.\n");
if (sshfs.idmap == IDMAP_USER)
sshfs.detect_uid = 1;
else if (sshfs.idmap == IDMAP_FILE) {
@@ -3984,18 +3993,6 @@ int main(int argc, char *argv[])
g_free(tmp);
g_free(fsname);
#if !defined(__CYGWIN__)
res = stat(sshfs.mountpoint, &st);
if (res == -1) {
perror(sshfs.mountpoint);
exit(1);
}
sshfs.mnt_mode = st.st_mode;
#elif defined(__CYGWIN__)
sshfs.mnt_mode = S_IFDIR | 0755;
#endif
if(sshfs.dir_cache)
sshfs.op = cache_wrap(&sshfs_oper);
else
+6 -3
View File
@@ -14,16 +14,19 @@ ninja --version
meson --version
# Install fuse
wget https://github.com/libfuse/libfuse/releases/download/fuse-3.0.2/fuse-3.0.2.tar.gz
tar xzf fuse-3.0.2.tar.gz
cd fuse-3.0.2
wget https://github.com/libfuse/libfuse/archive/master.zip
unzip master.zip
cd libfuse-master
mkdir build
cd build
export CC=gcc-6
meson ..
ninja
sudo ninja install
test -e /usr/local/lib/pkgconfig || sudo mkdir /usr/local/lib/pkgconfig
sudo mv /usr/local/lib/*/pkgconfig/* /usr/local/lib/pkgconfig/
ls -d1 /usr/local/lib/*-linux-gnu | sudo tee /etc/ld.so.conf.d/usrlocal.conf
sudo ldconfig
# Setup ssh
ssh-keygen -b 768 -t rsa -f ~/.ssh/id_rsa -P ''