Skip to content

Commit 652163e

Browse files
Yang Kaiyongimeoer
Yang Kaiyong
authored andcommitted
chore: bump deps and remove deprecated keys in deny.toml
Signed-off-by: Yang Kaiyong <[email protected]>
1 parent 36cd288 commit 652163e

File tree

14 files changed

+52
-86
lines changed

14 files changed

+52
-86
lines changed

Diff for: .github/workflows/rust.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ jobs:
6868
timeout-minutes: 10
6969
steps:
7070
- uses: actions/checkout@v3
71-
- uses: EmbarkStudios/cargo-deny-action@v1
71+
- uses: EmbarkStudios/cargo-deny-action@v2

Diff for: Cargo.toml

+9-5
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ nix = "0.24"
3030
radix_trie = "0.2.1"
3131
tokio = { version = "1", optional = true }
3232
tokio-uring = { version = "0.4.0", optional = true }
33-
vmm-sys-util = { version = "0.11", optional = true }
34-
vm-memory = { version = "0.10", features = ["backend-mmap"] }
35-
virtio-queue = { version = "0.7", optional = true }
33+
vmm-sys-util = { version = "0.12.1", optional = true }
34+
vm-memory = { version = "0.16.1", features = ["backend-mmap"] }
35+
virtio-queue = { version = "0.14.0", optional = true }
3636
vhost = { version = "0.6", features = ["vhost-user-slave"], optional = true }
3737
versionize_derive = { version = "0.1.6", optional = true }
3838
versionize = { version = "0.1.10", optional = true }
@@ -46,8 +46,8 @@ tokio-uring = { version = "0.4.0", optional = true }
4646

4747
[dev-dependencies]
4848
tokio-test = "0.4.2"
49-
vmm-sys-util = "0.11"
50-
vm-memory = { version = "0.10", features = ["backend-mmap", "backend-bitmap"] }
49+
vmm-sys-util = "0.12.0"
50+
vm-memory = { version = "0.16.1", features = ["backend-mmap", "backend-bitmap"] }
5151

5252
[features]
5353
default = ["fusedev"]
@@ -66,6 +66,7 @@ virtiofs = ["virtio-queue", "caps", "vmm-sys-util"]
6666
vhost-user-fs = ["virtiofs", "vhost", "caps"]
6767
persist = ["dbs-snapshot", "versionize", "versionize_derive"]
6868
fuse-t = []
69+
async_io = []
6970

7071
[package.metadata.docs.rs]
7172
all-features = true
@@ -74,3 +75,6 @@ targets = [
7475
"aarch64-unknown-linux-gnu",
7576
"aarch64-apple-darwin",
7677
]
78+
79+
[lints.rust]
80+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(testff)'] }

Diff for: deny.toml

+7-44
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# this list would mean the nix crate, as well as any of its exclusive
1818
# dependencies not shared by any other crates, would be ignored, as the target
1919
# list here is effectively saying which targets you are building for.
20+
[graph]
2021
targets = [
2122
# The triple can be any string, but only the target triples built in to
2223
# rustc (as of 1.40) can be checked against actual config expressions
@@ -35,26 +36,12 @@ targets = [
3536
db-path = "~/.cargo/advisory-db"
3637
# The url(s) of the advisory databases to use
3738
db-urls = ["https://github.com/rustsec/advisory-db"]
38-
# The lint level for security vulnerabilities
39-
vulnerability = "deny"
40-
# The lint level for unmaintained crates
41-
unmaintained = "warn"
39+
version = 2
4240
# The lint level for crates that have been yanked from their source registry
4341
yanked = "warn"
44-
# The lint level for crates with security notices. Note that as of
45-
# 2019-12-17 there are no security notice advisories in
46-
# https://github.com/rustsec/advisory-db
47-
notice = "warn"
4842
# A list of advisory IDs to ignore. Note that ignored advisories will still
4943
# output a note when they are encountered.
50-
ignore = [
51-
# stderrlog needs to fix it
52-
"RUSTSEC-2020-0071",
53-
# stderrlog needs to fix it
54-
"RUSTSEC-2020-0159",
55-
# stderrlog needs to fix it
56-
"RUSTSEC-2022-0006",
57-
]
44+
ignore = []
5845
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
5946
# lower than the range specified will be ignored. Note that ignored advisories
6047
# will still output a note when they are encountered.
@@ -63,45 +50,21 @@ ignore = [
6350
# * Medium - CVSS Score 4.0 - 6.9
6451
# * High - CVSS Score 7.0 - 8.9
6552
# * Critical - CVSS Score 9.0 - 10.0
66-
#severity-threshold =
53+
#severity-threshold =
6754

6855
# This section is considered when running `cargo deny check licenses`
6956
# More documentation for the licenses section can be found here:
7057
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
7158
[licenses]
72-
# The lint level for crates which do not have a detectable license
73-
unlicensed = "deny"
7459
# List of explictly allowed licenses
7560
# See https://spdx.org/licenses/ for list of possible licenses
7661
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
7762
allow = [
7863
"MIT",
7964
"Apache-2.0",
8065
"BSD-3-Clause",
81-
"Unicode-DFS-2016",
82-
]
83-
# List of explictly disallowed licenses
84-
# See https://spdx.org/licenses/ for list of possible licenses
85-
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
86-
deny = [
87-
"GPL-2.0",
88-
"GPL-3.0",
89-
#"Nokia",
66+
"Unicode-3.0",
9067
]
91-
# Lint level for licenses considered copyleft
92-
copyleft = "deny"
93-
# Blanket approval or denial for OSI-approved or FSF Free/Libre licenses
94-
# * both - The license will be approved if it is both OSI-approved *AND* FSF
95-
# * either - The license will be approved if it is either OSI-approved *OR* FSF
96-
# * osi-only - The license will be approved if is OSI-approved *AND NOT* FSF
97-
# * fsf-only - The license will be approved if is FSF *AND NOT* OSI-approved
98-
# * neither - This predicate is ignored and the default lint level is used
99-
allow-osi-fsf-free = "neither"
100-
# Lint level used when no other predicates are matched
101-
# 1. License isn't in the allow or deny lists
102-
# 2. License isn't copyleft
103-
# 3. License isn't OSI/FSF, or allow-osi-fsf-free = "neither"
104-
default = "deny"
10568
# The confidence threshold for detecting a license from license text.
10669
# The higher the value, the more closely the license text must be to the
10770
# canonical license text of a valid SPDX license file.
@@ -178,8 +141,8 @@ deny = [
178141
skip = [
179142
#{ name = "ansi_term", version = "=0.11.0" },
180143
]
181-
# Similarly to `skip` allows you to skip certain crates during duplicate
182-
# detection. Unlike skip, it also includes the entire tree of transitive
144+
# Similarly to `skip` allows you to skip certain crates during duplicate
145+
# detection. Unlike skip, it also includes the entire tree of transitive
183146
# dependencies starting at the specified crate, up to a certain depth, which is
184147
# by default infinite
185148
skip-tree = [

Diff for: src/api/filesystem/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ pub trait ZeroCopyReader: io::Read {
269269
) -> io::Result<usize> {
270270
let mut out = 0;
271271
loop {
272-
match self.read_to(f, ::std::usize::MAX, off) {
272+
match self.read_to(f, usize::MAX, off) {
273273
Ok(0) => return Ok(out),
274274
Ok(n) => {
275275
off = off.saturating_add(n as u64);
@@ -364,7 +364,7 @@ pub trait ZeroCopyWriter: io::Write {
364364
) -> io::Result<usize> {
365365
let mut out = 0;
366366
loop {
367-
match self.write_from(f, ::std::usize::MAX, off) {
367+
match self.write_from(f, usize::MAX, off) {
368368
Ok(0) => return Ok(out),
369369
Ok(n) => {
370370
off = off.saturating_add(n as u64);

Diff for: src/api/filesystem/overlay.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub trait Layer: FileSystem {
140140
Ok(v) => {
141141
// xattr name exists and we get value.
142142
if let GetxattrReply::Value(buf) = v {
143-
if buf.len() == 1 && buf[0].to_ascii_lowercase() == b'y' {
143+
if buf.len() == 1 && buf[0].eq_ignore_ascii_case(&b'y') {
144144
return Ok(true);
145145
}
146146
}

Diff for: src/api/server/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<F: FileSystem + Sync> Server<F> {
6868

6969
struct ZcReader<'a, S: BitmapSlice = ()>(Reader<'a, S>);
7070

71-
impl<'a, S: BitmapSlice> ZeroCopyReader for ZcReader<'a, S> {
71+
impl<S: BitmapSlice> ZeroCopyReader for ZcReader<'_, S> {
7272
fn read_to(
7373
&mut self,
7474
f: &mut dyn FileReadWriteVolatile,
@@ -79,15 +79,15 @@ impl<'a, S: BitmapSlice> ZeroCopyReader for ZcReader<'a, S> {
7979
}
8080
}
8181

82-
impl<'a, S: BitmapSlice> io::Read for ZcReader<'a, S> {
82+
impl<S: BitmapSlice> io::Read for ZcReader<'_, S> {
8383
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
8484
self.0.read(buf)
8585
}
8686
}
8787

8888
struct ZcWriter<'a, S: BitmapSlice = ()>(Writer<'a, S>);
8989

90-
impl<'a, S: BitmapSlice> ZeroCopyWriter for ZcWriter<'a, S> {
90+
impl<S: BitmapSlice> ZeroCopyWriter for ZcWriter<'_, S> {
9191
fn write_from(
9292
&mut self,
9393
f: &mut dyn FileReadWriteVolatile,
@@ -102,7 +102,7 @@ impl<'a, S: BitmapSlice> ZeroCopyWriter for ZcWriter<'a, S> {
102102
}
103103
}
104104

105-
impl<'a, S: BitmapSlice> io::Write for ZcWriter<'a, S> {
105+
impl<S: BitmapSlice> io::Write for ZcWriter<'_, S> {
106106
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
107107
self.0.write(buf)
108108
}

Diff for: src/api/server/sync_io.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,8 @@ impl<F: FileSystem + Sync> Server<F> {
734734
minor: KERNEL_MINOR_VERSION,
735735
max_readahead: readahead,
736736
flags: enabled_flags as u32,
737-
max_background: ::std::u16::MAX,
738-
congestion_threshold: (::std::u16::MAX / 4) * 3,
737+
max_background: u16::MAX,
738+
congestion_threshold: (u16::MAX / 4) * 3,
739739
max_write: MIN_READ_BUFFER - BUFFER_HEADER_SIZE,
740740
time_gran: 1, // nanoseconds
741741
flags2: (enabled_flags >> 32) as u32,
@@ -1251,7 +1251,7 @@ impl<F: FileSystem + Sync> Server<F> {
12511251
}
12521252
}
12531253

1254-
impl<'a, F: FileSystem, S: BitmapSlice> SrvContext<'a, F, S> {
1254+
impl<F: FileSystem, S: BitmapSlice> SrvContext<'_, F, S> {
12551255
fn reply_ok<T: ByteValued>(&mut self, out: Option<T>, data: Option<&[u8]>) -> Result<usize> {
12561256
let data2 = out.as_ref().map(|v| v.as_slice()).unwrap_or(&[]);
12571257
let data3 = data.unwrap_or(&[]);
@@ -1350,7 +1350,7 @@ fn add_dirent<S: BitmapSlice>(
13501350
d: DirEntry,
13511351
entry: Option<Entry>,
13521352
) -> io::Result<usize> {
1353-
if d.name.len() > ::std::u32::MAX as usize {
1353+
if d.name.len() > u32::MAX as usize {
13541354
return Err(io::Error::from_raw_os_error(libc::EOVERFLOW));
13551355
}
13561356

Diff for: src/common/file_buf.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ impl<'a> FileVolatileSlice<'a> {
125125
/// [`vm_memory::BitmapSlice`]: https://docs.rs/vm-memory/latest/vm_memory/bitmap/trait.BitmapSlice.html
126126
/// [`vm_memory::VolatileSlice`]: https://docs.rs/vm-memory/latest/vm_memory/volatile_memory/struct.VolatileSlice.html
127127
pub fn from_volatile_slice<S: BitmapSlice>(s: &VolatileSlice<'a, S>) -> Self {
128+
#[allow(deprecated)]
128129
Self::new(s.as_ptr(), s.len())
129130
}
130131

@@ -179,7 +180,7 @@ impl<'a> FileVolatileSlice<'a> {
179180
}
180181
}
181182

182-
impl<'a> Bytes<usize> for FileVolatileSlice<'a> {
183+
impl Bytes<usize> for FileVolatileSlice<'_> {
183184
type E = VError;
184185

185186
fn write(&self, buf: &[u8], addr: usize) -> Result<usize, Self::E> {
@@ -202,27 +203,31 @@ impl<'a> Bytes<usize> for FileVolatileSlice<'a> {
202203
where
203204
F: Read,
204205
{
206+
#[allow(deprecated)]
205207
VolatileSlice::read_from(&self.as_volatile_slice(), addr, src, count)
206208
}
207209

208210
fn read_exact_from<F>(&self, addr: usize, src: &mut F, count: usize) -> Result<(), Self::E>
209211
where
210212
F: Read,
211213
{
214+
#[allow(deprecated)]
212215
VolatileSlice::read_exact_from(&self.as_volatile_slice(), addr, src, count)
213216
}
214217

215218
fn write_to<F>(&self, addr: usize, dst: &mut F, count: usize) -> Result<usize, Self::E>
216219
where
217220
F: Write,
218221
{
222+
#[allow(deprecated)]
219223
VolatileSlice::write_to(&self.as_volatile_slice(), addr, dst, count)
220224
}
221225

222226
fn write_all_to<F>(&self, addr: usize, dst: &mut F, count: usize) -> Result<(), Self::E>
223227
where
224228
F: Write,
225229
{
230+
#[allow(deprecated)]
226231
VolatileSlice::write_all_to(&self.as_volatile_slice(), addr, dst, count)
227232
}
228233

Diff for: src/overlayfs/mod.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,7 @@ impl RealInode {
244244
// Open the directory and load each entry.
245245
let opendir_res = self.layer.opendir(ctx, self.inode, libc::O_RDONLY as u32);
246246
let handle = match opendir_res {
247-
Ok((handle, _)) => match handle {
248-
Some(h) => h,
249-
_ => 0,
250-
},
247+
Ok((handle, _)) => handle.unwrap_or_default(),
251248
// opendir may not be supported if no_opendir is set, so we can ignore this error.
252249
Err(e) => {
253250
match e.raw_os_error() {
@@ -970,9 +967,9 @@ impl OverlayFs {
970967
}
971968

972969
// Current file or dir.
973-
if name.eq(".")
970+
if name.eq(".")
974971
// Root directory has no parent.
975-
|| (parent == FUSE_ROOT_ID && name.eq(".."))
972+
|| (parent == FUSE_ROOT_ID && name.eq(".."))
976973
// Special convention: empty name indicates current dir.
977974
|| name.is_empty()
978975
{

Diff for: src/passthrough/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ pub struct Config {
161161
/// * If dax_file_size == None, DAX will disable to all files.
162162
/// * If dax_file_size == 0, DAX will enable all files.
163163
/// * If dax_file_size == N, DAX will enable only when the file size is greater than or equal
164-
/// to N Bytes.
164+
/// to N Bytes.
165165
pub dax_file_size: Option<u64>,
166166

167167
/// Reduce memory consumption by directly use host inode when possible.

Diff for: src/passthrough/sync_io.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -230,21 +230,20 @@ impl<S: BitmapSlice + Send + Sync> PassthroughFs<S> {
230230
inode: Inode,
231231
handle: Option<Handle>,
232232
) -> io::Result<(libc::stat64, Duration)> {
233-
let st;
234233
let data = self.inode_map.get(inode).map_err(|e| {
235234
error!("fuse: do_getattr ino {} Not find err {:?}", inode, e);
236235
e
237236
})?;
238237

239238
// kernel sends 0 as handle in case of no_open, and it depends on fuse server to handle
240239
// this case correctly.
241-
if !self.no_open.load(Ordering::Relaxed) && handle.is_some() {
240+
let st = if !self.no_open.load(Ordering::Relaxed) && handle.is_some() {
242241
// Safe as we just checked handle
243242
let hd = self.handle_map.get(handle.unwrap(), inode)?;
244-
st = stat_fd(hd.get_file(), None);
243+
stat_fd(hd.get_file(), None)
245244
} else {
246-
st = data.handle.stat();
247-
}
245+
data.handle.stat()
246+
};
248247

249248
let st = st.map_err(|e| {
250249
error!("fuse: do_getattr stat failed ino {} err {:?}", inode, e);
@@ -507,14 +506,13 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
507506
let ino = entry.inode;
508507
dir_entry.ino = entry.attr.st_ino;
509508

510-
add_entry(dir_entry, entry).map(|r| {
509+
add_entry(dir_entry, entry).inspect(|&r| {
511510
// true when size is not large enough to hold entry.
512511
if r == 0 {
513512
// Release the refcount acquired by self.do_lookup().
514513
let mut inodes = self.inode_map.get_map_mut();
515514
self.forget_one(&mut inodes, ino, 1);
516515
}
517-
r
518516
})
519517
})
520518
}

0 commit comments

Comments
 (0)