Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: some issues in 2.2 #1565

Merged
merged 7 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
export NYDUS_NYDUSIFY_$version_export=/usr/bin/nydus-$version/nydusify
done

curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v1.51.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin v1.57.1
sudo -E make smoke-only

nydus-unit-test:
Expand Down
136 changes: 112 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ indexmap = "1"
lazy_static = "1"
libc = "0.2"
log = "0.4.8"
mio = { version = "0.8", features = ["os-poll", "os-ext"] }
mio = { version = "0.8.11", features = ["os-poll", "os-ext"] }
nix = "0.24.0"
rlimit = "0.9.0"
serde = { version = "1.0.110", features = ["serde_derive", "rc"] }
Expand Down Expand Up @@ -97,4 +97,4 @@ backend-registry = ["nydus-storage/backend-registry"]
backend-s3 = ["nydus-storage/backend-s3"]

[workspace]
members = ["api", "app", "blobfs", "clib", "error", "rafs", "storage", "service", "utils"]
members = ["api", "app", "blobfs", "clib", "error", "rafs", "storage", "service", "utils"]
2 changes: 1 addition & 1 deletion rafs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pub trait RafsIoWrite: Write + Seek + 'static {

fn validate_alignment(&mut self, size: usize, alignment: usize) -> Result<usize> {
if alignment != 0 {
let cur = self.seek(SeekFrom::Current(0))?;
let cur = self.stream_position()?;

if (size & (alignment - 1) != 0) || (cur & (alignment as u64 - 1) != 0) {
return Err(einval!("unaligned data"));
Expand Down
4 changes: 2 additions & 2 deletions rafs/src/metadata/direct_v6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,9 @@ impl OndiskInodeWrapper {
Ok(())
}

fn get_entry_count<'a>(
fn get_entry_count(
&self,
state: &'a Guard<Arc<DirectMappingState>>,
state: &Guard<Arc<DirectMappingState>>,
inode: &dyn RafsV6OndiskInode,
block_index: usize,
) -> Result<usize> {
Expand Down
18 changes: 4 additions & 14 deletions rafs/src/metadata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,20 +534,15 @@ impl Default for RafsSuperMeta {
}

/// RAFS filesystem versions.
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Default)]
pub enum RafsVersion {
/// RAFS v5
#[default]
V5,
/// RAFS v6
V6,
}

impl Default for RafsVersion {
fn default() -> Self {
RafsVersion::V5
}
}

impl TryFrom<u32> for RafsVersion {
type Error = Error;

Expand Down Expand Up @@ -583,20 +578,15 @@ impl RafsVersion {
}

/// Rafs metadata working mode.
#[derive(Clone, Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq, Default)]
pub enum RafsMode {
/// Directly mapping and accessing metadata into process by mmap().
#[default]
Direct,
/// Read metadata into memory before using, for RAFS v5.
Cached,
}

impl Default for RafsMode {
fn default() -> Self {
RafsMode::Direct
}
}

impl FromStr for RafsMode {
type Err = Error;

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.66.1
1.70
Loading
Loading