Skip to content

Commit 35f6bf8

Browse files
authored
Fuser 0.9.1 (#49), in anticipation of ffs 0.1.2
Update to fuser=0.9 (i.e., 0.9.1). Update websites, version numbers, etc. for new release. Finally use `destroy` properly, got rid of the `Drop` impl for `FS`. Drop `AutoUnmount` which wasn't doing anything anyway. Fixes and improvements to CI, docs, and logging.
1 parent da6811a commit 35f6bf8

File tree

9 files changed

+31
-33
lines changed

9 files changed

+31
-33
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# ffs - Changelog
22

3-
## 0.?.? - UNRELEASED
3+
## 0.1.2 - 2021-09-26
44

55
* Handle failed mounts better, with an appropriate message and error
66
code.
77
* Revise exit codes: 0 means success, 1 means FS error, 2 means CLI
88
error.
99
* `--time` flag for emitting timing information on STDERR.
1010
* Basic startup/shutdown benchmarking, with microbenchmarks.
11+
* Upgrade to fuser 0.9.1. Concomitant bugfixes turn off AutoUnmount.
12+
* Improvements/bugfixes in regression tests.
1113

1214
## 0.1.1 - 2021-07-15
1315

Cargo.lock

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ffs"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
authors = ["Michael Greenberg <[email protected]>"]
55
license = "GPL-3.0"
66
description = "ffs---the File FileSystem---lets you mount semi-structured data (like JSON) as a filesystem, letting you work with modern formats using your familiar shell tools."
@@ -27,7 +27,7 @@ exclude = [
2727
[dependencies]
2828
base64 = "0.13.0"
2929
clap = "2.0"
30-
fuser = "0.8"
30+
fuser = "0.9"
3131
libc = "0.2.51"
3232
serde_json = "1.0"
3333
toml = "0.5"

docs/ffs.1.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% FFS(1) Version 0.1.1 | File Filesystem Documentation
1+
% FFS(1) Version 0.1.2 | File Filesystem Documentation
22
% Michael Greenberg
33

44
# NAME
@@ -240,7 +240,8 @@ RUST_LOG
240240
should probably be *ffs* and *level* should be one of *error*,
241241
*warn*, *info*, *debug*, or *trace*. The default is
242242
*ffs=warn*. Setting *-q* turns off all output; setting *-d* sets
243-
*ffs=debug*.
243+
*ffs=debug*. To get more information from FUSE bindings, add *fuser*, e.g.,
244+
*ffs=debug,fuser=info*.
244245

245246
# EXIT STATUS
246247

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ download a single executable. These are the [latest development builds](https://
100100
- [macOS]({{ site.github.macos_url }})
101101

102102
See the [release page](https://github.com/mgree/ffs/releases) for
103-
particular releases; the current version is 0.1.1. You can also build
103+
particular releases; the current version is 0.1.2. You can also build
104104
ffs from [source](https://github.com/mgree/ffs).
105105

106106
# Related tools

man/ffs.1

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" Automatically generated by Pandoc 2.9.1.1
22
.\"
3-
.TH "FFS" "1" "" "Version 0.1.1" "File Filesystem Documentation"
3+
.TH "FFS" "1" "" "Version 0.1.2" "File Filesystem Documentation"
44
.hy
55
.SH NAME
66
.PP
@@ -237,6 +237,8 @@ probably be \f[I]ffs\f[R] and \f[I]level\f[R] should be one of
237237
The default is \f[I]ffs=warn\f[R].
238238
Setting \f[I]-q\f[R] turns off all output; setting \f[I]-d\f[R] sets
239239
\f[I]ffs=debug\f[R].
240+
To get more information from FUSE bindings, add \f[I]fuser\f[R], e.g.,
241+
\f[I]ffs=debug,fuser=info\f[R].
240242
.SH EXIT STATUS
241243
.TP
242244
0

run_tests.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ for test in *.sh
2323
do
2424
tname="$(basename ${test%*.sh})"
2525
printf "========== STARTING TEST: $tname\n"
26-
(RUST_LOG="ffs=debug"; export RUST_LOG; ./${test} >$LOG/$tname.out 2>$LOG/$tname.nerr; echo $?>$LOG/$tname.ec) &
26+
(RUST_LOG="ffs=debug,fuser=debug"; export RUST_LOG; ./${test} >$LOG/$tname.out 2>$LOG/$tname.err; echo $?>$LOG/$tname.ec) &
2727
: $((TOTAL += 1))
2828

2929
# don't slam 'em
@@ -43,12 +43,17 @@ do
4343
printf "========== PASSED: $tname\n"
4444
else
4545
printf "========== FAILED: $tname (ec=$(cat $LOG/$tname.ec))\n"
46+
: $((FAILED += 1))
47+
fi
48+
49+
# just always capture output in the CI logs
50+
if [ "$(cat $LOG/$tname.ec)" -ne 0 ] || [ "$CI" ]
51+
then
4652
printf "<<<<<<<<<< STDOUT\n"
4753
cat $LOG/$tname.out
4854
printf "<<<<<<<<<< STDERR\n"
4955
cat $LOG/$tname.err
5056
printf "\n"
51-
: $((FAILED += 1))
5257
fi
5358
done
5459

src/fs.rs

+5-16
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl FS {
169169
///
170170
/// - if `self.config.output == Output::Stdout` and `last_sync == false`,
171171
/// nothing will happen (to prevent redundant writes to STDOUT)
172-
#[instrument(level = "debug", skip(self), fields(synced = self.dirty.get(), dirty = self.dirty.get()))]
172+
#[instrument(level = "debug", skip(self), fields(synced = self.synced.get(), dirty = self.dirty.get()))]
173173
pub fn sync(&self, last_sync: bool) {
174174
info!("called");
175175
trace!("{:?}", self.inodes);
@@ -347,29 +347,18 @@ impl FromStr for DirType {
347347
}
348348
}
349349

350-
impl Drop for FS {
351-
/// Synchronizes the `FS`, calling `FS::sync` with `last_sync == true`.
352-
#[instrument(level = "debug", skip(self), fields(dirty = self.dirty.get()))]
353-
fn drop(&mut self) {
354-
self.sync(true); // last sync
355-
}
356-
}
357-
358350
// ENOATTR is deprecated on Linux, so we should use ENODATA
359351
#[cfg(target_os = "linux")]
360352
const ENOATTR: i32 = libc::ENODATA;
361353
#[cfg(target_os = "macos")]
362354
const ENOATTR: i32 = libc::ENOATTR;
363355

364356
impl Filesystem for FS {
365-
#[instrument(level = "debug", skip(self, _req), fields(dirty = self.dirty.get()))]
366-
fn destroy(&mut self, _req: &Request) {
357+
/// Synchronizes the `FS`, calling `FS::sync` with `last_sync == true`.
358+
#[instrument(level = "debug", skip(self), fields(dirty = self.dirty.get()))]
359+
fn destroy(&mut self) {
367360
info!("called");
368-
// It WOULD make sense to call `sync` here, but this function doesn't
369-
// seem to be called on Linux... so we call `self.sync(true)` in
370-
// `Drop::drop`, instead.
371-
//
372-
// See https://github.com/cberner/fuser/issues/153
361+
self.sync(true);
373362
}
374363

375364
#[instrument(level = "debug", skip(self, _req, reply))]

src/main.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use fuser::MountOption;
1212
fn main() {
1313
let config = Config::from_args();
1414
let mut options = vec![
15-
MountOption::AutoUnmount,
1615
MountOption::FSName(format!("{}", config.input)),
1716
];
1817
if config.read_only {

0 commit comments

Comments
 (0)