From 502ea1074eaeeb9a2255e262488754b345911e6c Mon Sep 17 00:00:00 2001 From: Ankit Saurabh Date: Wed, 27 Sep 2023 17:47:56 +0100 Subject: [PATCH] Update vendored fuser to sync with upstream fuser (#538) * Update vendored fuser to 174a807 Signed-off-by: Ankit Saurabh * Updated the version of fuser Signed-off-by: Ankit Saurabh * Corrected the updated mountpoint-s3-client and mountpoint-s3-crt versions Signed-off-by: Ankit Saurabh * Reverting abi change Signed-off-by: Ankit Saurabh --------- Signed-off-by: Ankit Saurabh --- Cargo.lock | 17 +--- mountpoint-s3/Cargo.toml | 2 +- vendor/fuser/.github/workflows/ci.yml | 2 +- vendor/fuser/.github/workflows/macos_ci.yml | 86 --------------------- vendor/fuser/CHANGELOG.md | 4 + vendor/fuser/Cargo.toml | 5 +- vendor/fuser/README.md | 6 +- vendor/fuser/build.rs | 4 +- vendor/fuser/examples/simple.rs | 43 ++++++----- vendor/fuser/mount_tests.Dockerfile | 2 +- vendor/fuser/pjdfs.Dockerfile | 2 +- vendor/fuser/rustfmt.toml | 1 + vendor/fuser/src/lib.rs | 8 +- vendor/fuser/src/ll/reply.rs | 5 +- vendor/fuser/src/ll/request.rs | 22 +++--- vendor/fuser/src/mnt/fuse_pure.rs | 18 ++--- vendor/fuser/src/mnt/mod.rs | 1 + vendor/fuser/src/mnt/mount_options.rs | 10 +-- vendor/fuser/src/request.rs | 4 +- vendor/fuser/src/session.rs | 2 +- vendor/fuser/xfstests.Dockerfile | 2 +- 21 files changed, 82 insertions(+), 164 deletions(-) delete mode 100644 vendor/fuser/.github/workflows/macos_ci.yml create mode 100644 vendor/fuser/rustfmt.toml diff --git a/Cargo.lock b/Cargo.lock index 2ff907776..c3457ee91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1257,7 +1257,7 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "fuser" -version = "0.12.0" +version = "0.13.0" dependencies = [ "bincode", "clap 3.2.25", @@ -1270,7 +1270,6 @@ dependencies = [ "serde", "smallvec", "tempfile", - "users", "zerocopy", ] @@ -2203,9 +2202,9 @@ checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "page_size" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebde548fbbf1ea81a99b128872779c437752fb99f217c45245e1a61dcd9edcd" +checksum = "1b7663cbd190cfd818d08efa8497f6cd383076688c49a391ef7c0d03cd12b561" dependencies = [ "libc", "winapi", @@ -3428,16 +3427,6 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8db7427f936968176eaa7cdf81b7f98b980b18495ec28f1b5791ac3bfe3eea9" -[[package]] -name = "users" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24cc0f6d6f267b73e5a2cadf007ba8f9bc39c6a6f9666f8cf25ea809a153b032" -dependencies = [ - "libc", - "log", -] - [[package]] name = "utf8parse" version = "0.2.1" diff --git a/mountpoint-s3/Cargo.toml b/mountpoint-s3/Cargo.toml index 3b24c1bcd..dae63c594 100644 --- a/mountpoint-s3/Cargo.toml +++ b/mountpoint-s3/Cargo.toml @@ -6,7 +6,7 @@ license = "Apache-2.0" publish = false [dependencies] -fuser = { path = "../vendor/fuser", version = "0.12.0", features = ["abi-7-28"] } +fuser = { path = "../vendor/fuser", version = "0.13.0", features = ["abi-7-28"] } mountpoint-s3-client = { path = "../mountpoint-s3-client", version = "0.4.0" } mountpoint-s3-crt = { path = "../mountpoint-s3-crt", version = "0.3.0" } diff --git a/vendor/fuser/.github/workflows/ci.yml b/vendor/fuser/.github/workflows/ci.yml index d47ed0f94..c2e86b122 100644 --- a/vendor/fuser/.github/workflows/ci.yml +++ b/vendor/fuser/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - name: Install cargo-deny - run: cargo install --force cargo-deny --locked + run: cargo install --force --version 0.12.2 cargo-deny --locked - name: Run tests run: INTERACTIVE="" make ${{ matrix.test_group }} diff --git a/vendor/fuser/.github/workflows/macos_ci.yml b/vendor/fuser/.github/workflows/macos_ci.yml deleted file mode 100644 index ebd1db983..000000000 --- a/vendor/fuser/.github/workflows/macos_ci.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Macos CI - -on: - pull_request: -jobs: - ci-osxfuse: - runs-on: macos-10.15 - env: - PKG_CONFIG_PATH: /usr/local/lib/pkgconfig:$PKG_CONFIG_PATH - steps: - - uses: actions/checkout@v2 - - name: Install packages - run: | - brew update > /dev/null && brew install --cask osxfuse - - name: Start fuse - run: | - /Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.67 - components: rustfmt, clippy - default: true - - name: Cache cargo registry - uses: actions/cache@v1 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo index - uses: actions/cache@v1 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - name: Build all targets - run: cargo build --all --all-targets - - name: Build all targets, all features - run: cargo build --all --all-targets --all-features - - name: Run all tests - run: cargo test --all - - name: Run all tests, all features - run: cargo test --all --all-features - - name: Run cargo doc for all features - run: cargo doc --all --no-deps --all-features - - name: Run macos mount tests - run: bash osx_mount_tests.sh - ci-macfuse: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macos-10.15] - env: - PKG_CONFIG_PATH: /usr/local/lib/pkgconfig:$PKG_CONFIG_PATH - steps: - - uses: actions/checkout@v2 - - name: Install packages - run: | - brew update > /dev/null && brew install --cask macfuse - - name: Start fuse - run: | - /Library/Filesystems/macfuse.fs/Contents/Resources/load_macfuse - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.67 - components: rustfmt, clippy - default: true - - name: Cache cargo registry - uses: actions/cache@v1 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo index - uses: actions/cache@v1 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - name: Build all targets - run: cargo build --all --all-targets - - name: Build all targets, all features - run: cargo build --all --all-targets --all-features - - name: Run all tests - run: cargo test --all - - name: Run all tests, all features - run: cargo test --all --all-features - - name: Run cargo doc for all features - run: cargo doc --all --no-deps --all-features - - name: Run macos mount tests - run: bash osx_mount_tests.sh diff --git a/vendor/fuser/CHANGELOG.md b/vendor/fuser/CHANGELOG.md index 63c0306a0..e5f87809c 100644 --- a/vendor/fuser/CHANGELOG.md +++ b/vendor/fuser/CHANGELOG.md @@ -1,5 +1,9 @@ # FUSE for Rust - Changelog +## 0.13.0 - 2023-08-16 +* Remove dependency on `users` crate +* Performance optimizations + ## 0.12.0 - 2022-12-13 * Add method to `Session` to unmount non-`Send` `Filesystem`s diff --git a/vendor/fuser/Cargo.toml b/vendor/fuser/Cargo.toml index d7e1c5d91..687d17f37 100644 --- a/vendor/fuser/Cargo.toml +++ b/vendor/fuser/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "fuser" edition = "2018" -version = "0.12.0" +version = "0.13.0" authors = ["Christopher Berner "] description = "Filesystem in Userspace (FUSE) for Rust" documentation = "https://docs.rs/fuser" @@ -20,8 +20,7 @@ travis-ci = { repository = "cberner/fuser" } libc = "0.2.51" log = "0.4.6" memchr = "2" -users = "0.11.0" -page_size = "0.4.2" +page_size = "0.5.0" serde = { version = "1.0.102", features = ["std", "derive"], optional = true } smallvec = "1.6.1" zerocopy = "0.6" diff --git a/vendor/fuser/README.md b/vendor/fuser/README.md index 9ad58d100..b82af4b42 100644 --- a/vendor/fuser/README.md +++ b/vendor/fuser/README.md @@ -46,7 +46,7 @@ To build FUSE-Rust or any program that depends on it, `pkg-config` needs to be i [FUSE for Linux] is available in most Linux distributions and usually called `fuse` or `fuse3` (this crate is compatible with both). To install on a Debian based system: ```sh -sudo apt-get install fuse +sudo apt-get install fuse3 libfuse3-dev ``` Install on CentOS: @@ -65,7 +65,7 @@ sudo apt-get install libfuse-dev pkg-config sudo yum install fuse-devel pkgconfig ``` -### macOS +### macOS (untested) Installer packages can be downloaded from the [FUSE for macOS homepage][FUSE for macOS]. This is the *kernel* part that needs to be installed always. @@ -118,7 +118,7 @@ Most features of libfuse up to 3.10.3 are implemented. Feel free to contribute. ## Compatibility -Developed and tested on Linux. Tested under [Linux][FUSE for Linux], [macOS][FUSE for macOS] (up to ABI 7.19) and [FreeBSD][FUSE for FreeBSD] using stable [Rust] (see CI for details). +Developed and tested on Linux. Tested under [Linux][FUSE for Linux] and [FreeBSD][FUSE for FreeBSD] using stable [Rust] (see CI for details). ## Contribution diff --git a/vendor/fuser/build.rs b/vendor/fuser/build.rs index 8a1dc9713..b5c14a2cb 100644 --- a/vendor/fuser/build.rs +++ b/vendor/fuser/build.rs @@ -28,7 +28,7 @@ fn main() { if pkg_config::Config::new() .atleast_version("3.0.0") .probe("fuse3") - .map_err(|e| eprintln!("{}", e)) + .map_err(|e| eprintln!("{e}")) .is_ok() { println!("cargo:rustc-cfg=feature=\"libfuse3\""); @@ -37,7 +37,7 @@ fn main() { pkg_config::Config::new() .atleast_version("2.6.0") .probe("fuse") - .map_err(|e| eprintln!("{}", e)) + .map_err(|e| eprintln!("{e}")) .unwrap(); println!("cargo:rustc-cfg=feature=\"libfuse2\""); } diff --git a/vendor/fuser/examples/simple.rs b/vendor/fuser/examples/simple.rs index 226c4fbee..83c7eaecc 100644 --- a/vendor/fuser/examples/simple.rs +++ b/vendor/fuser/examples/simple.rs @@ -1,4 +1,5 @@ #![allow(clippy::needless_return)] +#![allow(clippy::unnecessary_cast)] // libc::S_* are u16 or u32 depending on the platform use clap::{crate_version, Arg, Command}; use fuser::consts::FOPEN_DIRECT_IO; @@ -334,7 +335,7 @@ impl SimpleFS { let path = Path::new(&self.data_dir) .join("contents") .join(inode.to_string()); - if let Ok(file) = File::open(&path) { + if let Ok(file) = File::open(path) { Ok(bincode::deserialize_from(file).unwrap()) } else { Err(libc::ENOENT) @@ -349,7 +350,7 @@ impl SimpleFS { .write(true) .create(true) .truncate(true) - .open(&path) + .open(path) .unwrap(); bincode::serialize_into(file, &entries).unwrap(); } @@ -358,7 +359,7 @@ impl SimpleFS { let path = Path::new(&self.data_dir) .join("inodes") .join(inode.to_string()); - if let Ok(file) = File::open(&path) { + if let Ok(file) = File::open(path) { Ok(bincode::deserialize_from(file).unwrap()) } else { Err(libc::ENOENT) @@ -373,7 +374,7 @@ impl SimpleFS { .write(true) .create(true) .truncate(true) - .open(&path) + .open(path) .unwrap(); bincode::serialize_into(file, inode).unwrap(); } @@ -415,7 +416,7 @@ impl SimpleFS { } let path = self.content_path(inode); - let file = OpenOptions::new().write(true).open(&path).unwrap(); + let file = OpenOptions::new().write(true).open(path).unwrap(); file.set_len(new_length).unwrap(); attrs.size = new_length; @@ -728,7 +729,7 @@ impl Filesystem for SimpleFS { fn readlink(&self, _req: &Request, inode: u64, reply: ReplyData) { debug!("readlink() called on {:?}", inode); let path = self.content_path(inode); - if let Ok(mut file) = File::open(&path) { + if let Ok(mut file) = File::open(path) { let file_size = file.metadata().unwrap().len(); let mut buffer = vec![0; file_size as usize]; file.read_exact(&mut buffer).unwrap(); @@ -1021,11 +1022,14 @@ impl Filesystem for SimpleFS { &self, req: &Request, parent: u64, - name: &OsStr, - link: &Path, + link_name: &OsStr, + target: &Path, reply: ReplyEntry, ) { - debug!("symlink() called with {:?} {:?} {:?}", parent, name, link); + debug!( + "symlink() called with {:?} {:?} {:?}", + parent, link_name, target + ); let mut parent_attrs = match self.get_inode(parent) { Ok(attrs) => attrs, Err(error_code) => { @@ -1053,7 +1057,7 @@ impl Filesystem for SimpleFS { let attrs = InodeAttributes { inode, open_file_handles: 0, - size: link.as_os_str().as_bytes().len() as u64, + size: target.as_os_str().as_bytes().len() as u64, last_accessed: time_now(), last_modified: time_now(), last_metadata_changed: time_now(), @@ -1065,7 +1069,8 @@ impl Filesystem for SimpleFS { xattrs: Default::default(), }; - if let Err(error_code) = self.insert_link(req, parent, name, inode, FileKind::Symlink) { + if let Err(error_code) = self.insert_link(req, parent, link_name, inode, FileKind::Symlink) + { reply.error(error_code); return; } @@ -1076,9 +1081,9 @@ impl Filesystem for SimpleFS { .write(true) .create(true) .truncate(true) - .open(&path) + .open(path) .unwrap(); - file.write_all(link.as_os_str().as_bytes()).unwrap(); + file.write_all(target.as_os_str().as_bytes()).unwrap(); reply.entry(&Duration::new(0, 0), &attrs.into(), 0); } @@ -1389,7 +1394,7 @@ impl Filesystem for SimpleFS { } let path = self.content_path(inode); - if let Ok(file) = File::open(&path) { + if let Ok(file) = File::open(path) { let file_size = file.metadata().unwrap().len(); // Could underflow if file length is less than local_start let read_size = min(size, file_size.saturating_sub(offset as u64) as u32); @@ -1422,7 +1427,7 @@ impl Filesystem for SimpleFS { } let path = self.content_path(inode); - if let Ok(mut file) = OpenOptions::new().write(true).open(&path) { + if let Ok(mut file) = OpenOptions::new().write(true).open(path) { file.seek(SeekFrom::Start(offset as u64)).unwrap(); file.write_all(data).unwrap(); @@ -1790,7 +1795,7 @@ impl Filesystem for SimpleFS { reply: ReplyEmpty, ) { let path = self.content_path(inode); - if let Ok(file) = OpenOptions::new().write(true).open(&path) { + if let Ok(file) = OpenOptions::new().write(true).open(path) { unsafe { libc::fallocate64(file.into_raw_fd(), mode, offset, length); } @@ -1836,7 +1841,7 @@ impl Filesystem for SimpleFS { } let src_path = self.content_path(src_inode); - if let Ok(file) = File::open(&src_path) { + if let Ok(file) = File::open(src_path) { let file_size = file.metadata().unwrap().len(); // Could underflow if file length is less than local_start let read_size = min(size, file_size.saturating_sub(src_offset as u64)); @@ -1845,7 +1850,7 @@ impl Filesystem for SimpleFS { file.read_exact_at(&mut data, src_offset as u64).unwrap(); let dest_path = self.content_path(dest_inode); - if let Ok(mut file) = OpenOptions::new().write(true).open(&dest_path) { + if let Ok(mut file) = OpenOptions::new().write(true).open(dest_path) { file.seek(SeekFrom::Start(dest_offset as u64)).unwrap(); file.write_all(&data).unwrap(); @@ -1919,7 +1924,7 @@ fn as_file_kind(mut mode: u32) -> FileKind { fn get_groups(pid: u32) -> Vec { #[cfg(not(target_os = "macos"))] { - let path = format!("/proc/{}/task/{}/status", pid, pid); + let path = format!("/proc/{pid}/task/{pid}/status"); let file = File::open(path).unwrap(); for line in BufReader::new(file).lines() { let line = line.unwrap(); diff --git a/vendor/fuser/mount_tests.Dockerfile b/vendor/fuser/mount_tests.Dockerfile index 4bc2b8d80..79cbdb4cc 100644 --- a/vendor/fuser/mount_tests.Dockerfile +++ b/vendor/fuser/mount_tests.Dockerfile @@ -4,7 +4,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt update && apt install -y build-essential curl -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.57.0 +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.67.0 ENV PATH=/root/.cargo/bin:$PATH diff --git a/vendor/fuser/pjdfs.Dockerfile b/vendor/fuser/pjdfs.Dockerfile index b8e50895b..75205f2f5 100644 --- a/vendor/fuser/pjdfs.Dockerfile +++ b/vendor/fuser/pjdfs.Dockerfile @@ -12,7 +12,7 @@ RUN echo 'user_allow_other' >> /etc/fuse.conf RUN mkdir -p /code/pjdfstest && cd /code && git clone https://github.com/fleetfs/pjdfstest && cd pjdfstest \ && git checkout d3beed6f5f15c204a8af3df2f518241931a42e94 && autoreconf -ifs && ./configure && make pjdfstest -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.57.0 +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.67.0 ENV PATH=/root/.cargo/bin:$PATH ARG BUILD_FEATURES diff --git a/vendor/fuser/rustfmt.toml b/vendor/fuser/rustfmt.toml new file mode 100644 index 000000000..758d4179d --- /dev/null +++ b/vendor/fuser/rustfmt.toml @@ -0,0 +1 @@ +max_width = 100 diff --git a/vendor/fuser/src/lib.rs b/vendor/fuser/src/lib.rs index 15207252b..78cbb9143 100644 --- a/vendor/fuser/src/lib.rs +++ b/vendor/fuser/src/lib.rs @@ -423,13 +423,13 @@ pub trait Filesystem { &self, _req: &Request<'_>, parent: u64, - name: &OsStr, - link: &Path, + link_name: &OsStr, + target: &Path, reply: ReplyEntry, ) { debug!( - "[Not Implemented] symlink(parent: {:#x?}, name: {:?}, link: {:?})", - parent, name, link, + "[Not Implemented] symlink(parent: {:#x?}, link_name: {:?}, target: {:?})", + parent, link_name, target, ); reply.error(EPERM); } diff --git a/vendor/fuser/src/ll/reply.rs b/vendor/fuser/src/ll/reply.rs index cba77aad2..8a7cb64c3 100644 --- a/vendor/fuser/src/ll/reply.rs +++ b/vendor/fuser/src/ll/reply.rs @@ -49,8 +49,8 @@ impl<'a> Response<'a> { let mut v: SmallVec<[IoSlice<'_>; 3]> = smallvec![IoSlice::new(header.as_bytes())]; match &self { Response::Error(_) => {} - Response::Data(d) => v.push(IoSlice::new(d.as_ref())), - Response::Slice(d) => v.push(IoSlice::new(d.as_ref())), + Response::Data(d) => v.push(IoSlice::new(d)), + Response::Slice(d) => v.push(IoSlice::new(d)), } f(&v) } @@ -258,6 +258,7 @@ pub(crate) fn time_from_system_time(system_time: &SystemTime) -> (i64, u32) { // Some platforms like Linux x86_64 have mode_t = u32, and lint warns of a trivial_numeric_casts. // But others like macOS x86_64 have mode_t = u16, requiring a typecast. So, just silence lint. #[allow(trivial_numeric_casts)] +#[allow(clippy::unnecessary_cast)] /// Returns the mode for a given file kind and permission pub(crate) fn mode_from_kind_and_perm(kind: FileType, perm: u16) -> u32 { (match kind { diff --git a/vendor/fuser/src/ll/request.rs b/vendor/fuser/src/ll/request.rs index 9a65a0661..c8d166f29 100644 --- a/vendor/fuser/src/ll/request.rs +++ b/vendor/fuser/src/ll/request.rs @@ -193,13 +193,12 @@ impl fmt::Display for RequestError { match self { RequestError::ShortReadHeader(len) => write!( f, - "Short read of FUSE request header ({} < {})", - len, + "Short read of FUSE request header ({len} < {})", mem::size_of::() ), - RequestError::UnknownOperation(opcode) => write!(f, "Unknown FUSE opcode ({})", opcode), + RequestError::UnknownOperation(opcode) => write!(f, "Unknown FUSE opcode ({opcode})"), RequestError::ShortRead(len, total) => { - write!(f, "Short read of FUSE request ({} < {})", len, total) + write!(f, "Short read of FUSE request ({len} < {total})") } RequestError::InsufficientData => write!(f, "Insufficient argument data"), } @@ -490,15 +489,15 @@ mod op { pub struct SymLink<'a> { header: &'a fuse_in_header, target: &'a Path, - link: &'a Path, + link_name: &'a Path, } impl_request!(SymLink<'_>); impl<'a> SymLink<'a> { pub fn target(&self) -> &'a Path { self.target } - pub fn link(&self) -> &'a Path { - self.link + pub fn link_name(&self) -> &'a Path { + self.link_name } } @@ -1625,8 +1624,8 @@ mod op { fuse_opcode::FUSE_READLINK => Operation::ReadLink(ReadLink { header }), fuse_opcode::FUSE_SYMLINK => Operation::SymLink(SymLink { header, + link_name: data.fetch_str()?.as_ref(), target: data.fetch_str()?.as_ref(), - link: data.fetch_str()?.as_ref(), }), fuse_opcode::FUSE_MKNOD => Operation::MkNod(MkNod { header, @@ -1919,7 +1918,12 @@ impl<'a> fmt::Display for Operation<'a> { Operation::SetAttr(x) => x.fmt(f), Operation::ReadLink(_) => write!(f, "READLINK"), Operation::SymLink(x) => { - write!(f, "SYMLINK target {:?}, link {:?}", x.target(), x.link()) + write!( + f, + "SYMLINK target {:?}, link_name {:?}", + x.target(), + x.link_name() + ) } Operation::MkNod(x) => write!( f, diff --git a/vendor/fuser/src/mnt/fuse_pure.rs b/vendor/fuser/src/mnt/fuse_pure.rs index ea366dfbd..594e18d36 100644 --- a/vendor/fuser/src/mnt/fuse_pure.rs +++ b/vendor/fuser/src/mnt/fuse_pure.rs @@ -128,8 +128,8 @@ fn detect_fusermount_bin() -> String { for name in [ FUSERMOUNT3_BIN.to_string(), FUSERMOUNT_BIN.to_string(), - format!("/bin/{}", FUSERMOUNT3_BIN), - format!("/bin/{}", FUSERMOUNT_BIN), + format!("/bin/{FUSERMOUNT3_BIN}"), + format!("/bin/{FUSERMOUNT_BIN}"), ] .iter() { @@ -144,7 +144,7 @@ fn detect_fusermount_bin() -> String { fn receive_fusermount_message(socket: &UnixStream) -> Result { let mut io_vec_buf = [0u8]; let mut io_vec = libc::iovec { - iov_base: (&mut io_vec_buf).as_mut_ptr() as *mut libc::c_void, + iov_base: io_vec_buf.as_mut_ptr() as *mut libc::c_void, iov_len: io_vec_buf.len(), }; let cmsg_buffer_len = unsafe { libc::CMSG_SPACE(mem::size_of::() as libc::c_uint) }; @@ -157,7 +157,7 @@ fn receive_fusermount_message(socket: &UnixStream) -> Result { msg_namelen: 0, msg_iov: &mut io_vec, msg_iovlen: 1, - msg_control: (&mut cmsg_buffer).as_mut_ptr() as *mut libc::c_void, + msg_control: cmsg_buffer.as_mut_ptr() as *mut libc::c_void, msg_controllen: cmsg_buffer.len(), msg_flags: 0, }; @@ -343,13 +343,13 @@ fn fuse_mount_sys(mountpoint: &OsStr, options: &[MountOption]) -> Result Result Result Result<(), io::Error> { let mut options_set = HashSet::new(); options_set.extend(options.iter().cloned()); - let conflicting: HashSet = options.iter().map(conflicts_with).flatten().collect(); + let conflicting: HashSet = options.iter().flat_map(conflicts_with).collect(); let intersection: Vec = conflicting.intersection(&options_set).cloned().collect(); if !intersection.is_empty() { Err(io::Error::new( ErrorKind::InvalidInput, - format!("Conflicting mount options found: {:?}", intersection), + format!("Conflicting mount options found: {intersection:?}"), )) } else { Ok(()) @@ -129,8 +129,8 @@ fn conflicts_with(option: &MountOption) -> Vec { // Format option to be passed to libfuse or kernel pub fn option_to_string(option: &MountOption) -> String { match option { - MountOption::FSName(name) => format!("fsname={}", name), - MountOption::Subtype(subtype) => format!("subtype={}", subtype), + MountOption::FSName(name) => format!("fsname={name}"), + MountOption::Subtype(subtype) => format!("subtype={subtype}"), MountOption::CUSTOM(value) => value.to_string(), MountOption::AutoUnmount => "auto_unmount".to_string(), MountOption::AllowOther => "allow_other".to_string(), @@ -171,7 +171,7 @@ pub(crate) fn parse_options_from_args(args: &[&OsStr]) -> io::Result &x[2..], - Some(x) => return Err(err(format!("Error parsing args: expected -o, got {}", x))), + Some(x) => return Err(err(format!("Error parsing args: expected -o, got {x}"))), }; for x in opt.split(',') { out.push(MountOption::from_str(x)) diff --git a/vendor/fuser/src/request.rs b/vendor/fuser/src/request.rs index d9366ff0d..936c31959 100644 --- a/vendor/fuser/src/request.rs +++ b/vendor/fuser/src/request.rs @@ -275,8 +275,8 @@ impl<'a> Request<'a> { se.filesystem.symlink( self, self.request.nodeid().into(), - x.target().as_ref(), - Path::new(x.link()), + x.link_name().as_ref(), + Path::new(x.target()), self.reply(), ); } diff --git a/vendor/fuser/src/session.rs b/vendor/fuser/src/session.rs index b91497b77..7f0e363ff 100644 --- a/vendor/fuser/src/session.rs +++ b/vendor/fuser/src/session.rs @@ -260,7 +260,7 @@ impl BackgroundSession { // replace with #[derive(Debug)] if Debug ever gets implemented for // thread_scoped::JoinGuard -impl<'a> fmt::Debug for BackgroundSession { +impl fmt::Debug for BackgroundSession { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { write!( f, diff --git a/vendor/fuser/xfstests.Dockerfile b/vendor/fuser/xfstests.Dockerfile index 82c5ba89c..c169761c9 100644 --- a/vendor/fuser/xfstests.Dockerfile +++ b/vendor/fuser/xfstests.Dockerfile @@ -9,7 +9,7 @@ RUN adduser --disabled-password --gecos '' fsgqa RUN echo 'user_allow_other' >> /etc/fuse.conf -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.57.0 +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.67.0 ENV PATH=/root/.cargo/bin:$PATH