Fixup whitespace and configure CI to keep it that way
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
# See https://pre-commit.com for more information
|
||||||
|
# See https://pre-commit.com/hooks.html for more hooks
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v4.0.1
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: check-yaml
|
||||||
|
- id: check-added-large-files
|
||||||
|
- repo: https://github.com/jumanjihouse/pre-commit-hooks
|
||||||
|
rev: 2.1.5
|
||||||
|
hooks:
|
||||||
|
- id: shellcheck
|
||||||
+15
-5
@@ -1,11 +1,14 @@
|
|||||||
dist: focal
|
dist: focal
|
||||||
sudo: enabled
|
|
||||||
|
|
||||||
language:
|
language: c
|
||||||
- c
|
|
||||||
|
cache:
|
||||||
|
- pip
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
|
- shellcheck
|
||||||
- valgrind
|
- valgrind
|
||||||
- gcc
|
- gcc
|
||||||
- clang
|
- clang
|
||||||
@@ -16,6 +19,13 @@ addons:
|
|||||||
- meson
|
- meson
|
||||||
- python3-pytest
|
- python3-pytest
|
||||||
- libglib2.0-dev
|
- libglib2.0-dev
|
||||||
install: test/travis-install.sh
|
|
||||||
script: test/travis-build.sh
|
|
||||||
|
|
||||||
|
install: test/travis-install.sh
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
include:
|
||||||
|
- name: Lint
|
||||||
|
script: ./test/lint.sh
|
||||||
|
install: skip
|
||||||
|
- name: Build + Test
|
||||||
|
script: test/travis-build.sh
|
||||||
|
|||||||
+7
-7
@@ -25,7 +25,7 @@ Release 3.7.0 (2020-01-03)
|
|||||||
needed anymore. If you depend on this workaround, please let the SSHFS maintainers know,
|
needed anymore. If you depend on this workaround, please let the SSHFS maintainers know,
|
||||||
otherwise support for the workaround will be removed completely in a future version.
|
otherwise support for the workaround will be removed completely in a future version.
|
||||||
|
|
||||||
|
|
||||||
Release 3.6.0 (2019-11-03)
|
Release 3.6.0 (2019-11-03)
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
@@ -108,13 +108,13 @@ Release 3.1.0 (2017-08-04)
|
|||||||
|
|
||||||
* For improved backwards compatibility, SSHFS now also silently
|
* For improved backwards compatibility, SSHFS now also silently
|
||||||
accepts the old ``-o cache_*`` options.
|
accepts the old ``-o cache_*`` options.
|
||||||
|
|
||||||
Release 3.0.0 (2017-07-08)
|
Release 3.0.0 (2017-07-08)
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
* sshfs now requires libfuse 3.1.0 or newer.
|
* sshfs now requires libfuse 3.1.0 or newer.
|
||||||
* When supported by the kernel, sshfs now uses writeback caching.
|
* When supported by the kernel, sshfs now uses writeback caching.
|
||||||
* The `cache` option has been renamed to `dir_cache` for clarity.
|
* The `cache` option has been renamed to `dir_cache` for clarity.
|
||||||
* Added unit tests
|
* Added unit tests
|
||||||
* --debug now behaves like -o debug_sshfs, i.e. it enables sshfs
|
* --debug now behaves like -o debug_sshfs, i.e. it enables sshfs
|
||||||
debugging messages rather than libfuse debugging messages.
|
debugging messages rather than libfuse debugging messages.
|
||||||
@@ -129,7 +129,7 @@ Release 3.0.0 (2017-07-08)
|
|||||||
* Removed support for `-o workaround=all`. Workarounds should always
|
* Removed support for `-o workaround=all`. Workarounds should always
|
||||||
enabled explicitly and only when needed. There is no point in always
|
enabled explicitly and only when needed. There is no point in always
|
||||||
enabling a potentially changing set of workarounds.
|
enabling a potentially changing set of workarounds.
|
||||||
|
|
||||||
Release 2.9 (2017-04-17)
|
Release 2.9 (2017-04-17)
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
@@ -168,14 +168,14 @@ Release 2.4 (2012-03-08)
|
|||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
* New `slave` option.
|
* New `slave` option.
|
||||||
* New `idmap`, `uidmap` and `gidmap` options.
|
* New `idmap`, `uidmap` and `gidmap` options.
|
||||||
* Various small bugfixes.
|
* Various small bugfixes.
|
||||||
|
|
||||||
Release 2.3 (2011-07-01)
|
Release 2.3 (2011-07-01)
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
* Support hard link creation if server is OpenSSH 5.7 or later
|
* Support hard link creation if server is OpenSSH 5.7 or later
|
||||||
* Small improvements and bug fixes
|
* Small improvements and bug fixes
|
||||||
* Check mount point and options before connecting to ssh server
|
* Check mount point and options before connecting to ssh server
|
||||||
* New 'delay_connect' option
|
* New 'delay_connect' option
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ Release 2.2 (2008-10-20)
|
|||||||
Release 2.1 (2008-07-11)
|
Release 2.1 (2008-07-11)
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
* Small improvements and bug fixes
|
* Small improvements and bug fixes
|
||||||
|
|
||||||
Release 2.0 (2008-04-23)
|
Release 2.0 (2008-04-23)
|
||||||
------------------------
|
------------------------
|
||||||
|
|||||||
+1
-1
@@ -72,7 +72,7 @@ Normally, the default build options will work fine. If you
|
|||||||
nevertheless want to adjust them, you can do so with the *mesonconf*
|
nevertheless want to adjust them, you can do so with the *mesonconf*
|
||||||
command::
|
command::
|
||||||
|
|
||||||
$ mesonconf # list options
|
$ mesonconf # list options
|
||||||
$ mesonconf -D strip=true # set an option
|
$ mesonconf -D strip=true # set an option
|
||||||
|
|
||||||
To build, test and install SSHFS, you then use Ninja (running the
|
To build, test and install SSHFS, you then use Ninja (running the
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ static void *cache_init(struct fuse_conn_info *conn,
|
|||||||
{
|
{
|
||||||
void *res;
|
void *res;
|
||||||
res = cache.next_oper->init(conn, cfg);
|
res = cache.next_oper->init(conn, cfg);
|
||||||
|
|
||||||
// Cache requires a path for each request
|
// Cache requires a path for each request
|
||||||
cfg->nullpath_ok = 0;
|
cfg->nullpath_ok = 0;
|
||||||
|
|
||||||
@@ -318,9 +318,9 @@ static int cache_releasedir(const char *path, struct fuse_file_info *fi)
|
|||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
struct file_handle *cfi;
|
struct file_handle *cfi;
|
||||||
|
|
||||||
cfi = (struct file_handle*) fi->fh;
|
cfi = (struct file_handle*) fi->fh;
|
||||||
|
|
||||||
if(cfi->is_open) {
|
if(cfi->is_open) {
|
||||||
fi->fh = cfi->fs_fh;
|
fi->fh = cfi->fs_fh;
|
||||||
err = cache.next_oper->releasedir(path, fi);
|
err = cache.next_oper->releasedir(path, fi);
|
||||||
@@ -365,7 +365,7 @@ static int cache_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
|
|||||||
struct node *node;
|
struct node *node;
|
||||||
|
|
||||||
assert(offset == 0);
|
assert(offset == 0);
|
||||||
|
|
||||||
pthread_mutex_lock(&cache.lock);
|
pthread_mutex_lock(&cache.lock);
|
||||||
node = cache_lookup(path);
|
node = cache_lookup(path);
|
||||||
if (node != NULL && node->dir != NULL) {
|
if (node != NULL && node->dir != NULL) {
|
||||||
@@ -391,8 +391,8 @@ static int cache_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
|
|||||||
}
|
}
|
||||||
cfi->is_open = 1;
|
cfi->is_open = 1;
|
||||||
cfi->fs_fh = fi->fh;
|
cfi->fs_fh = fi->fh;
|
||||||
}
|
}
|
||||||
|
|
||||||
ch.path = path;
|
ch.path = path;
|
||||||
ch.buf = buf;
|
ch.buf = buf;
|
||||||
ch.filler = filler;
|
ch.filler = filler;
|
||||||
|
|||||||
@@ -27,4 +27,3 @@ gpg --armor --detach-sign "${TAG}.tar.xz"
|
|||||||
PREV_TAG="$(git tag --list 'sshfs-3*' --sort=-taggerdate --merged "${TAG}^"| head -1)"
|
PREV_TAG="$(git tag --list 'sshfs-3*' --sort=-taggerdate --merged "${TAG}^"| head -1)"
|
||||||
echo "Contributors from ${PREV_TAG} to ${TAG}:"
|
echo "Contributors from ${PREV_TAG} to ${TAG}:"
|
||||||
git log --pretty="format:%an <%aE>" "${PREV_TAG}..${TAG}" | sort -u
|
git log --pretty="format:%an <%aE>" "${PREV_TAG}..${TAG}" | sort -u
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -26,7 +26,7 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
rst2man = find_program('rst2man', 'rst2man.py', required: false)
|
rst2man = find_program('rst2man', 'rst2man.py', required: false)
|
||||||
|
|
||||||
cfg = configuration_data()
|
cfg = configuration_data()
|
||||||
|
|
||||||
cfg.set_quoted('PACKAGE_VERSION', meson.project_version())
|
cfg.set_quoted('PACKAGE_VERSION', meson.project_version())
|
||||||
@@ -69,4 +69,3 @@ meson.add_install_script('utils/install_helper.sh',
|
|||||||
|
|
||||||
|
|
||||||
subdir('test')
|
subdir('test')
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@
|
|||||||
/*
|
/*
|
||||||
Handling of multiple SFTP connections
|
Handling of multiple SFTP connections
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
|
|
||||||
An SFTP server is free to return responses to outstanding requests in arbitrary
|
An SFTP server is free to return responses to outstanding requests in arbitrary
|
||||||
order. However, execution of requests may only be re-ordered and parallelized as long
|
order. However, execution of requests may only be re-ordered and parallelized as long
|
||||||
as "the results in the responses will be the same as if [the client] had sent the
|
as "the results in the responses will be the same as if [the client] had sent the
|
||||||
@@ -158,11 +158,11 @@
|
|||||||
involved) wait for the other requests to complete. This means that e.g. a readdir
|
involved) wait for the other requests to complete. This means that e.g. a readdir
|
||||||
request would have to block on most other activity in the same directory, eliminating a
|
request would have to block on most other activity in the same directory, eliminating a
|
||||||
major advantage of using multiple connections.
|
major advantage of using multiple connections.
|
||||||
|
|
||||||
In practice, we can luckily take advantage of the knowledge that most FUSE requests are
|
In practice, we can luckily take advantage of the knowledge that most FUSE requests are
|
||||||
the result of (synchronous) syscalls from userspace that will block until the
|
the result of (synchronous) syscalls from userspace that will block until the
|
||||||
corresponding FUSE response has been sent.
|
corresponding FUSE response has been sent.
|
||||||
|
|
||||||
If -o sshfs_sync is used, SSHFS always waits for the SFTP server response before
|
If -o sshfs_sync is used, SSHFS always waits for the SFTP server response before
|
||||||
returning a FUSE response to userspace. If userspace makes concurrent system calls,
|
returning a FUSE response to userspace. If userspace makes concurrent system calls,
|
||||||
there is no ordering guarantee in the first place, so we do not have to worry about
|
there is no ordering guarantee in the first place, so we do not have to worry about
|
||||||
@@ -523,7 +523,7 @@ static struct fuse_opt sshfs_opts[] = {
|
|||||||
/* For backwards compatibility */
|
/* For backwards compatibility */
|
||||||
SSHFS_OPT("cache=yes", dir_cache, 1),
|
SSHFS_OPT("cache=yes", dir_cache, 1),
|
||||||
SSHFS_OPT("cache=no", dir_cache, 0),
|
SSHFS_OPT("cache=no", dir_cache, 0),
|
||||||
|
|
||||||
FUSE_OPT_KEY("writeback_cache=no", FUSE_OPT_KEY_DISCARD),
|
FUSE_OPT_KEY("writeback_cache=no", FUSE_OPT_KEY_DISCARD),
|
||||||
FUSE_OPT_KEY("unreliable_append", FUSE_OPT_KEY_DISCARD),
|
FUSE_OPT_KEY("unreliable_append", FUSE_OPT_KEY_DISCARD),
|
||||||
|
|
||||||
@@ -1073,7 +1073,7 @@ static struct conn* get_conn(const struct sshfs_file *sf,
|
|||||||
|
|
||||||
if (sshfs.max_conns == 1)
|
if (sshfs.max_conns == 1)
|
||||||
return &sshfs.conns[0];
|
return &sshfs.conns[0];
|
||||||
|
|
||||||
if (sf != NULL)
|
if (sf != NULL)
|
||||||
return sf->conn;
|
return sf->conn;
|
||||||
|
|
||||||
@@ -1906,7 +1906,7 @@ static void *sshfs_init(struct fuse_conn_info *conn,
|
|||||||
|
|
||||||
// SFTP only supports 1-second time resolution
|
// SFTP only supports 1-second time resolution
|
||||||
conn->time_gran = 1000000000;
|
conn->time_gran = 1000000000;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2371,13 +2371,13 @@ static int sshfs_mkdir(const char *path, mode_t mode)
|
|||||||
// Commutes with pending write(), so we can use any connection
|
// Commutes with pending write(), so we can use any connection
|
||||||
err = sftp_request(get_conn(NULL, NULL), SSH_FXP_MKDIR, &buf, SSH_FXP_STATUS, NULL);
|
err = sftp_request(get_conn(NULL, NULL), SSH_FXP_MKDIR, &buf, SSH_FXP_STATUS, NULL);
|
||||||
buf_free(&buf);
|
buf_free(&buf);
|
||||||
|
|
||||||
if (err == -EPERM) {
|
if (err == -EPERM) {
|
||||||
if (sshfs.op->access(path, R_OK) == 0) {
|
if (sshfs.op->access(path, R_OK) == 0) {
|
||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2394,7 +2394,7 @@ static int sshfs_mknod(const char *path, mode_t mode, dev_t rdev)
|
|||||||
|
|
||||||
// Commutes with pending write(), so we can use any connection
|
// Commutes with pending write(), so we can use any connection
|
||||||
conn = get_conn(NULL, NULL);
|
conn = get_conn(NULL, NULL);
|
||||||
|
|
||||||
buf_init(&buf, 0);
|
buf_init(&buf, 0);
|
||||||
buf_add_path(&buf, path);
|
buf_add_path(&buf, path);
|
||||||
buf_add_uint32(&buf, SSH_FXF_WRITE | SSH_FXF_CREAT | SSH_FXF_EXCL);
|
buf_add_uint32(&buf, SSH_FXF_WRITE | SSH_FXF_CREAT | SSH_FXF_EXCL);
|
||||||
@@ -2532,7 +2532,7 @@ static int sshfs_rename(const char *from, const char *to, unsigned int flags)
|
|||||||
}
|
}
|
||||||
pthread_mutex_unlock(&sshfs.lock);
|
pthread_mutex_unlock(&sshfs.lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2589,12 +2589,12 @@ static int sshfs_chmod(const char *path, mode_t mode,
|
|||||||
buf_init(&buf, 0);
|
buf_init(&buf, 0);
|
||||||
if (sf == NULL)
|
if (sf == NULL)
|
||||||
buf_add_path(&buf, path);
|
buf_add_path(&buf, path);
|
||||||
else
|
else
|
||||||
buf_add_buf(&buf, &sf->handle);
|
buf_add_buf(&buf, &sf->handle);
|
||||||
|
|
||||||
buf_add_uint32(&buf, SSH_FILEXFER_ATTR_PERMISSIONS);
|
buf_add_uint32(&buf, SSH_FILEXFER_ATTR_PERMISSIONS);
|
||||||
buf_add_uint32(&buf, mode);
|
buf_add_uint32(&buf, mode);
|
||||||
|
|
||||||
/* FIXME: really needs LSETSTAT extension (debian Bug#640038) */
|
/* FIXME: really needs LSETSTAT extension (debian Bug#640038) */
|
||||||
// Commutes with pending write(), so we can use any connection
|
// Commutes with pending write(), so we can use any connection
|
||||||
// if the file is not open.
|
// if the file is not open.
|
||||||
@@ -2618,7 +2618,7 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid,
|
|||||||
if (!sshfs_file_is_conn(sf))
|
if (!sshfs_file_is_conn(sf))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sshfs.remote_uid_detected) {
|
if (sshfs.remote_uid_detected) {
|
||||||
if (uid == sshfs.local_uid)
|
if (uid == sshfs.local_uid)
|
||||||
uid = sshfs.remote_uid;
|
uid = sshfs.remote_uid;
|
||||||
@@ -2635,7 +2635,7 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid,
|
|||||||
buf_init(&buf, 0);
|
buf_init(&buf, 0);
|
||||||
if (sf == NULL)
|
if (sf == NULL)
|
||||||
buf_add_path(&buf, path);
|
buf_add_path(&buf, path);
|
||||||
else
|
else
|
||||||
buf_add_buf(&buf, &sf->handle);
|
buf_add_buf(&buf, &sf->handle);
|
||||||
buf_add_uint32(&buf, SSH_FILEXFER_ATTR_UIDGID);
|
buf_add_uint32(&buf, SSH_FILEXFER_ATTR_UIDGID);
|
||||||
buf_add_uint32(&buf, uid);
|
buf_add_uint32(&buf, uid);
|
||||||
@@ -2685,7 +2685,7 @@ static int sshfs_utimens(const char *path, const struct timespec tv[2],
|
|||||||
buf_init(&buf, 0);
|
buf_init(&buf, 0);
|
||||||
if (sf == NULL)
|
if (sf == NULL)
|
||||||
buf_add_path(&buf, path);
|
buf_add_path(&buf, path);
|
||||||
else
|
else
|
||||||
buf_add_buf(&buf, &sf->handle);
|
buf_add_buf(&buf, &sf->handle);
|
||||||
buf_add_uint32(&buf, SSH_FILEXFER_ATTR_ACMODTIME);
|
buf_add_uint32(&buf, SSH_FILEXFER_ATTR_ACMODTIME);
|
||||||
buf_add_uint32(&buf, asec);
|
buf_add_uint32(&buf, asec);
|
||||||
@@ -2740,7 +2740,7 @@ static int sshfs_open_common(const char *path, mode_t mode,
|
|||||||
|
|
||||||
if (fi->flags & O_APPEND)
|
if (fi->flags & O_APPEND)
|
||||||
pflags |= SSH_FXF_APPEND;
|
pflags |= SSH_FXF_APPEND;
|
||||||
|
|
||||||
sf = g_new0(struct sshfs_file, 1);
|
sf = g_new0(struct sshfs_file, 1);
|
||||||
list_init(&sf->write_reqs);
|
list_init(&sf->write_reqs);
|
||||||
pthread_cond_init(&sf->write_finished, NULL);
|
pthread_cond_init(&sf->write_finished, NULL);
|
||||||
@@ -2750,7 +2750,7 @@ static int sshfs_open_common(const char *path, mode_t mode,
|
|||||||
pthread_mutex_lock(&sshfs.lock);
|
pthread_mutex_lock(&sshfs.lock);
|
||||||
sf->modifver= sshfs.modifver;
|
sf->modifver= sshfs.modifver;
|
||||||
if (sshfs.max_conns > 1) {
|
if (sshfs.max_conns > 1) {
|
||||||
ce = g_hash_table_lookup(sshfs.conntab, path);
|
ce = g_hash_table_lookup(sshfs.conntab, path);
|
||||||
if (!ce) {
|
if (!ce) {
|
||||||
ce = g_malloc(sizeof(struct conntab_entry));
|
ce = g_malloc(sizeof(struct conntab_entry));
|
||||||
ce->refcount = 0;
|
ce->refcount = 0;
|
||||||
@@ -3354,7 +3354,7 @@ static int sshfs_truncate(const char *path, off_t size,
|
|||||||
sshfs_inc_modifver();
|
sshfs_inc_modifver();
|
||||||
if (sshfs.truncate_workaround)
|
if (sshfs.truncate_workaround)
|
||||||
return sshfs_truncate_workaround(path, size, fi);
|
return sshfs_truncate_workaround(path, size, fi);
|
||||||
|
|
||||||
buf_init(&buf, 0);
|
buf_init(&buf, 0);
|
||||||
|
|
||||||
if (sf != NULL)
|
if (sf != NULL)
|
||||||
@@ -3397,7 +3397,7 @@ static int sshfs_getattr(const char *path, struct stat *stbuf,
|
|||||||
buf_add_buf(&buf, &sf->handle);
|
buf_add_buf(&buf, &sf->handle);
|
||||||
err = sftp_request(sf->conn, SSH_FXP_FSTAT, &buf,
|
err = sftp_request(sf->conn, SSH_FXP_FSTAT, &buf,
|
||||||
SSH_FXP_ATTRS, &outbuf);
|
SSH_FXP_ATTRS, &outbuf);
|
||||||
}
|
}
|
||||||
if (!err) {
|
if (!err) {
|
||||||
err = buf_get_attrs(&outbuf, stbuf, NULL);
|
err = buf_get_attrs(&outbuf, stbuf, NULL);
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
|||||||
@@ -190,17 +190,17 @@ Options
|
|||||||
directory cache holds the names of directory entries. Enabling it
|
directory cache holds the names of directory entries. Enabling it
|
||||||
allows `readdir(3)` system calls to be processed without network
|
allows `readdir(3)` system calls to be processed without network
|
||||||
access.
|
access.
|
||||||
|
|
||||||
-o dcache_max_size=N
|
-o dcache_max_size=N
|
||||||
sets the maximum size of the directory cache.
|
sets the maximum size of the directory cache.
|
||||||
|
|
||||||
-o dcache_timeout=N
|
-o dcache_timeout=N
|
||||||
sets timeout for directory cache in seconds.
|
sets timeout for directory cache in seconds.
|
||||||
|
|
||||||
-o dcache_{stat,link,dir}_timeout=N
|
-o dcache_{stat,link,dir}_timeout=N
|
||||||
sets separate timeout for {attributes, symlinks, names} in the
|
sets separate timeout for {attributes, symlinks, names} in the
|
||||||
directory cache.
|
directory cache.
|
||||||
|
|
||||||
-o dcache_clean_interval=N
|
-o dcache_clean_interval=N
|
||||||
sets the interval for automatic cleaning of the directory cache.
|
sets the interval for automatic cleaning of the directory cache.
|
||||||
|
|
||||||
@@ -209,17 +209,17 @@ Options
|
|||||||
when full.
|
when full.
|
||||||
|
|
||||||
-o direct_io
|
-o direct_io
|
||||||
This option disables the use of page cache (file content cache) in
|
This option disables the use of page cache (file content cache) in
|
||||||
the kernel for this filesystem.
|
the kernel for this filesystem.
|
||||||
This has several affects:
|
This has several affects:
|
||||||
|
|
||||||
1. Each read() or write() system call will initiate one or more read or
|
1. Each read() or write() system call will initiate one or more read or
|
||||||
write operations, data will not be cached in the kernel.
|
write operations, data will not be cached in the kernel.
|
||||||
|
|
||||||
2. The return value of the read() and write() system calls will correspond
|
2. The return value of the read() and write() system calls will correspond
|
||||||
to the return values of the read and write operations. This is useful
|
to the return values of the read and write operations. This is useful
|
||||||
for example if the file size is not known in advance (before reading it).
|
for example if the file size is not known in advance (before reading it).
|
||||||
e.g. /proc filesystem
|
e.g. /proc filesystem
|
||||||
|
|
||||||
-o max_conns=N
|
-o max_conns=N
|
||||||
sets the maximum number of simultaneous SSH connections
|
sets the maximum number of simultaneous SSH connections
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
machine=$(uname -m)
|
machine=$(uname -m)
|
||||||
mkdir "build-$machine"
|
mkdir "build-$machine"
|
||||||
|
|||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
pip3 install --user pre-commit
|
||||||
|
pre-commit run --all-files --show-diff-on-failure
|
||||||
+1
-1
@@ -2,7 +2,7 @@ test_scripts = [ 'conftest.py', 'pytest.ini', 'test_sshfs.py',
|
|||||||
'util.py' ]
|
'util.py' ]
|
||||||
custom_target('test_scripts', input: test_scripts,
|
custom_target('test_scripts', input: test_scripts,
|
||||||
output: test_scripts, build_by_default: true,
|
output: test_scripts, build_by_default: true,
|
||||||
command: ['cp', '-fPp',
|
command: ['cp', '-fPp',
|
||||||
'@INPUT@', meson.current_build_dir() ])
|
'@INPUT@', meson.current_build_dir() ])
|
||||||
|
|
||||||
# Provide something helpful when running 'ninja test'
|
# Provide something helpful when running 'ninja test'
|
||||||
|
|||||||
+6
-6
@@ -35,15 +35,15 @@ def name_generator(__ctr=[0]):
|
|||||||
@pytest.mark.parametrize("sync_rd", (True, False))
|
@pytest.mark.parametrize("sync_rd", (True, False))
|
||||||
@pytest.mark.parametrize("multiconn", (True,False))
|
@pytest.mark.parametrize("multiconn", (True,False))
|
||||||
def test_sshfs(tmpdir, debug, cache_timeout, sync_rd, multiconn, capfd):
|
def test_sshfs(tmpdir, debug, cache_timeout, sync_rd, multiconn, capfd):
|
||||||
|
|
||||||
# Avoid false positives from debug messages
|
# Avoid false positives from debug messages
|
||||||
#if debug:
|
#if debug:
|
||||||
# capfd.register_output(r'^ unique: [0-9]+, error: -[0-9]+ .+$',
|
# capfd.register_output(r'^ unique: [0-9]+, error: -[0-9]+ .+$',
|
||||||
# count=0)
|
# count=0)
|
||||||
|
|
||||||
# Avoid false positives from storing key for localhost
|
# Avoid false positives from storing key for localhost
|
||||||
capfd.register_output(r"^Warning: Permanently added 'localhost' .+", count=0)
|
capfd.register_output(r"^Warning: Permanently added 'localhost' .+", count=0)
|
||||||
|
|
||||||
# Test if we can ssh into localhost without password
|
# Test if we can ssh into localhost without password
|
||||||
try:
|
try:
|
||||||
res = subprocess.call(['ssh', '-o', 'KbdInteractiveAuthentication=no',
|
res = subprocess.call(['ssh', '-o', 'KbdInteractiveAuthentication=no',
|
||||||
@@ -80,12 +80,12 @@ def test_sshfs(tmpdir, debug, cache_timeout, sync_rd, multiconn, capfd):
|
|||||||
|
|
||||||
if multiconn:
|
if multiconn:
|
||||||
cmdline += [ '-o', 'max_conns=3' ]
|
cmdline += [ '-o', 'max_conns=3' ]
|
||||||
|
|
||||||
new_env = dict(os.environ) # copy, don't modify
|
new_env = dict(os.environ) # copy, don't modify
|
||||||
|
|
||||||
# Abort on warnings from glib
|
# Abort on warnings from glib
|
||||||
new_env['G_DEBUG'] = 'fatal-warnings'
|
new_env['G_DEBUG'] = 'fatal-warnings'
|
||||||
|
|
||||||
mount_process = subprocess.Popen(cmdline, env=new_env)
|
mount_process = subprocess.Popen(cmdline, env=new_env)
|
||||||
try:
|
try:
|
||||||
wait_for_mount(mount_process, mnt_dir)
|
wait_for_mount(mount_process, mnt_dir)
|
||||||
@@ -299,7 +299,7 @@ def tst_link(mnt_dir, cache_timeout):
|
|||||||
# we need to wait until the cached value has expired.
|
# we need to wait until the cached value has expired.
|
||||||
if cache_timeout:
|
if cache_timeout:
|
||||||
safe_sleep(cache_timeout)
|
safe_sleep(cache_timeout)
|
||||||
|
|
||||||
fstat1 = os.lstat(name1)
|
fstat1 = os.lstat(name1)
|
||||||
fstat2 = os.lstat(name2)
|
fstat2 = os.lstat(name2)
|
||||||
for attr in ('st_mode', 'st_dev', 'st_uid', 'st_gid',
|
for attr in ('st_mode', 'st_dev', 'st_uid', 'st_gid',
|
||||||
|
|||||||
@@ -6,36 +6,40 @@ set -e
|
|||||||
# that we still need to fix
|
# that we still need to fix
|
||||||
export ASAN_OPTIONS="detect_leaks=0"
|
export ASAN_OPTIONS="detect_leaks=0"
|
||||||
|
|
||||||
export LSAN_OPTIONS="suppressions=$(pwd)/test/lsan_suppress.txt"
|
export LSAN_OPTIONS="suppressions=${PWD}/test/lsan_suppress.txt"
|
||||||
export CC
|
export CC
|
||||||
|
|
||||||
TEST_CMD="python3 -m pytest --maxfail=99 test/"
|
TEST_CMD="python3 -m pytest --maxfail=99 test/"
|
||||||
|
|
||||||
# Standard build with Valgrind
|
# Standard build with Valgrind
|
||||||
for CC in gcc clang; do
|
for CC in gcc clang; do
|
||||||
|
(
|
||||||
mkdir "build-${CC}"; cd "build-${CC}"
|
mkdir "build-${CC}"; cd "build-${CC}"
|
||||||
if [ "${CC}" == 'gcc-6' ]; then
|
if [ "${CC}" == 'gcc-6' ]; then
|
||||||
build_opts='-D b_lundef=false'
|
build_opts='-D b_lundef=false'
|
||||||
else
|
else
|
||||||
build_opts=''
|
build_opts=''
|
||||||
fi
|
fi
|
||||||
|
# shellcheck disable=SC2086
|
||||||
meson -D werror=true ${build_opts} ../
|
meson -D werror=true ${build_opts} ../
|
||||||
ninja
|
ninja
|
||||||
|
|
||||||
TEST_WITH_VALGRIND=true ${TEST_CMD}
|
TEST_WITH_VALGRIND=true ${TEST_CMD}
|
||||||
cd ..
|
)
|
||||||
done
|
done
|
||||||
(cd "build-${CC}"; sudo ninja install)
|
(cd "build-${CC}"; sudo ninja install)
|
||||||
|
|
||||||
# Sanitized build
|
# Sanitized build
|
||||||
CC=clang
|
CC=clang
|
||||||
for san in undefined address; do
|
for san in undefined address; do
|
||||||
mkdir "build-${san}"; cd "build-${san}"
|
(
|
||||||
|
mkdir "build-${san}"
|
||||||
|
cd "build-${san}"
|
||||||
# b_lundef=false is required to work around clang
|
# b_lundef=false is required to work around clang
|
||||||
# bug, cf. https://groups.google.com/forum/#!topic/mesonbuild/tgEdAXIIdC4
|
# bug, cf. https://groups.google.com/forum/#!topic/mesonbuild/tgEdAXIIdC4
|
||||||
meson -D b_sanitize=${san} -D b_lundef=false -D werror=true ..
|
meson -D b_sanitize=${san} -D b_lundef=false -D werror=true ..
|
||||||
ninja
|
ninja
|
||||||
${TEST_CMD}
|
${TEST_CMD}
|
||||||
sudo ninja install
|
sudo ninja install
|
||||||
cd ..
|
)
|
||||||
done
|
done
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ def cleanup(mount_process, mnt_dir):
|
|||||||
mount_process.wait(1)
|
mount_process.wait(1)
|
||||||
except subprocess.TimeoutExpired:
|
except subprocess.TimeoutExpired:
|
||||||
mount_process.kill()
|
mount_process.kill()
|
||||||
|
|
||||||
|
|
||||||
def umount(mount_process, mnt_dir):
|
def umount(mount_process, mnt_dir):
|
||||||
subprocess.check_call(['fusermount3', '-z', '-u', mnt_dir ])
|
subprocess.check_call(['fusermount3', '-z', '-u', mnt_dir ])
|
||||||
|
|||||||
Reference in New Issue
Block a user