Update to 0.1.5

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2018-02-11 14:34:36 +01:00
parent f73e3d4e42
commit db890c97d6
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C
11 changed files with 11 additions and 296 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/stratisd-0.1.4.tar.gz
/stratisd-0.1.5.tar.gz

View File

@ -1,26 +0,0 @@
From a40a1d6cfc5c38fdee2749b1153ef8bf267ff24e Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenko@redhat.com>
Date: Mon, 8 Jan 2018 16:34:29 +0100
Subject: [PATCH] add dbus service
Without it, stratisd is not activatable.
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
---
org.storage.stratis1.service | 4 ++++
1 file changed, 4 insertions(+)
create mode 100644 org.storage.stratis1.service
diff --git a/org.storage.stratis1.service b/org.storage.stratis1.service
new file mode 100644
index 0000000..4f3e92b
--- /dev/null
+++ b/org.storage.stratis1.service
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=org.storage.stratis1
+Exec=/usr/libexec/stratisd
+User=root
--
2.15.1

View File

@ -1,60 +0,0 @@
From fb276f9634e2a2aa935fb23e541cb2d60674f756 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenko@redhat.com>
Date: Mon, 8 Jan 2018 01:52:33 +0100
Subject: [PATCH] cast stat.f_bsize to u64
It's defined as c_ulong and compilation fails on 32bit systems with:
--> src/engine/strat_engine/thinpool/filesystem.rs:233:30
|
233 | Ok((Bytes(stat.f_bsize * stat.f_blocks), Bytes(stat.f_bsize * (stat.f_blocks - stat.f_bfree))))
| ^^^^^^^^^^^^^ expected u32, found u64
error[E0308]: mismatched types
--> src/engine/strat_engine/thinpool/filesystem.rs:233:15
|
233 | Ok((Bytes(stat.f_bsize * stat.f_blocks), Bytes(stat.f_bsize * (stat.f_blocks - stat.f_bfree))))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u64, found u32
error[E0277]: the trait bound `u32: std::ops::Mul<u64>` is not satisfied
--> src/engine/strat_engine/thinpool/filesystem.rs:233:28
|
233 | Ok((Bytes(stat.f_bsize * stat.f_blocks), Bytes(stat.f_bsize * (stat.f_blocks - stat.f_bfree))))
| ^ no implementation for `u32 * u64`
|
= help: the trait `std::ops::Mul<u64>` is not implemented for `u32`
error[E0308]: mismatched types
--> src/engine/strat_engine/thinpool/filesystem.rs:233:67
|
233 | Ok((Bytes(stat.f_bsize * stat.f_blocks), Bytes(stat.f_bsize * (stat.f_blocks - stat.f_bfree))))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u32, found u64
error[E0308]: mismatched types
--> src/engine/strat_engine/thinpool/filesystem.rs:233:52
|
233 | Ok((Bytes(stat.f_bsize * stat.f_blocks), Bytes(stat.f_bsize * (stat.f_blocks - stat.f_bfree))))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u64, found u32
error[E0277]: the trait bound `u32: std::ops::Mul<u64>` is not satisfied
--> src/engine/strat_engine/thinpool/filesystem.rs:233:65
|
233 | Ok((Bytes(stat.f_bsize * stat.f_blocks), Bytes(stat.f_bsize * (stat.f_blocks - stat.f_bfree))))
| ^ no implementation for `u32 * u64`
|
= help: the trait `std::ops::Mul<u64>` is not implemented for `u32`
Fixes: https://github.com/stratis-storage/stratisd/issues/707
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
---
src/engine/strat_engine/thinpool/filesystem.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/engine/strat_engine/thinpool/filesystem.rs b/src/engine/strat_engine/thinpool/filesystem.rs
index d381644..97aa5d4 100644
--- a/src/engine/strat_engine/thinpool/filesystem.rs
+++ b/src/engine/strat_engine/thinpool/filesystem.rs
@@ -230,5 +230,5 @@ impl Recordable<FilesystemSave> for StratFilesystem {
pub fn fs_usage(mount_point: &Path) -> EngineResult<(Bytes, Bytes)> {
let mut stat = Statvfs::default();
statvfs(mount_point, &mut stat)?;
- Ok((Bytes(stat.f_bsize * stat.f_blocks), Bytes(stat.f_bsize * (stat.f_blocks - stat.f_bfree))))
+ Ok((Bytes(stat.f_bsize as u64 * stat.f_blocks), Bytes(stat.f_bsize as u64 * (stat.f_blocks - stat.f_bfree))))
}
--
2.15.1

View File

@ -1,24 +0,0 @@
From 54cdf6f34d96fcfc902bc153b6ca46db3195cf02 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenko@redhat.com>
Date: Fri, 5 Jan 2018 21:36:00 +0100
Subject: [PATCH 1/6] deps: update quickcheck to 0.6
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
---
Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Cargo.toml b/Cargo.toml
index 66d9176..5d7fceb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -31,5 +31,5 @@ version = "0.5"
features = ["serde", "v4"]
[dev-dependencies]
-quickcheck = "0.4"
+quickcheck = "0.6"
loopdev = "0.1.1"
--
2.15.1

View File

@ -1,50 +0,0 @@
From 48adfc646f088f7b94cbbb912dee71e2068d6dd6 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenko@redhat.com>
Date: Fri, 5 Jan 2018 21:38:12 +0100
Subject: [PATCH 2/6] deps: update rand to 0.4
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
---
Cargo.toml | 2 +-
src/engine/strat_engine/blockdevmgr.rs | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
index 5d7fceb..cab096a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@ byteorder = "0.3.13"
chrono = "0.4"
macro-attr = "0.2.0"
term = "0.4"
-rand = "0.3.10"
+rand = "0.4"
serde = "1"
serde_derive = "1"
serde_json = "1"
diff --git a/src/engine/strat_engine/blockdevmgr.rs b/src/engine/strat_engine/blockdevmgr.rs
index 21996fe..3d13fda 100644
--- a/src/engine/strat_engine/blockdevmgr.rs
+++ b/src/engine/strat_engine/blockdevmgr.rs
@@ -9,7 +9,7 @@ use std::fs::{File, OpenOptions};
use std::path::{Path, PathBuf};
use chrono::{DateTime, Duration, Utc};
-use rand::{thread_rng, sample};
+use rand::{thread_rng, seq};
use uuid::Uuid;
use devicemapper::{Bytes, Device, IEC, Sectors, Segment};
@@ -203,7 +203,8 @@ impl BlockDevMgr {
// TODO: consider making selection not entirely random, i.e, ensuring
// distribution of metadata over different paths.
- let saved = sample(&mut thread_rng(), candidates, MAX_NUM_TO_WRITE)
+ let saved = seq::sample_iter(&mut thread_rng(), candidates, MAX_NUM_TO_WRITE)
+ .unwrap_or_else(|e| e)
.iter_mut()
.fold(false,
|acc, b| acc | b.save_state(&stamp_time, metadata).is_ok());
--
2.15.1

View File

@ -1,26 +0,0 @@
From c2d1f403a3a00c0afff4bd10ef7b6374e7ac62f2 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenko@redhat.com>
Date: Fri, 5 Jan 2018 21:40:56 +0100
Subject: [PATCH 3/6] deps: update byteorder to 1
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
---
Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Cargo.toml b/Cargo.toml
index cab096a..5b57b5d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ clap = "1"
nix = "0.9"
devicemapper = "0.15"
crc = "1"
-byteorder = "0.3.13"
+byteorder = "1"
chrono = "0.4"
macro-attr = "0.2.0"
term = "0.4"
--
2.15.1

View File

@ -1,26 +0,0 @@
From 2e08305f111166b8f515dabbd73594c6447bc3b5 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenko@redhat.com>
Date: Fri, 5 Jan 2018 21:41:50 +0100
Subject: [PATCH 4/6] deps: update env_logger to 0.4
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
---
Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Cargo.toml b/Cargo.toml
index 5b57b5d..2664303 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,7 +19,7 @@ serde_derive = "1"
serde_json = "1"
tempdir = "0.3.5"
log = "0.3"
-env_logger="0.3.5"
+env_logger="0.4"
libc = "0.2"
clippy = {version = "*", optional = true}
mnt = "0.3.1"
--
2.15.1

View File

@ -1,26 +0,0 @@
From ba87ca3e47a4d5eb9dd32d49a25ac5b9b1345af6 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenko@redhat.com>
Date: Fri, 5 Jan 2018 21:44:00 +0100
Subject: [PATCH 5/6] deps: update clap to 2
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
---
Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Cargo.toml b/Cargo.toml
index 2664303..3991ba0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,7 +5,7 @@ authors = ["Stratis Developers <stratis-devel@lists.fedorahosted.com>"]
[dependencies]
dbus = "0.6.1"
-clap = "1"
+clap = "2"
nix = "0.9"
devicemapper = "0.15"
crc = "1"
--
2.15.1

View File

@ -1,52 +0,0 @@
From 893e01cf24b29a01dcf8640e24a070d606c7fae7 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenko@redhat.com>
Date: Fri, 5 Jan 2018 21:47:15 +0100
Subject: [PATCH 6/6] deps: update loopdev to 0.2
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
---
Cargo.toml | 2 +-
src/engine/strat_engine/tests/loopbacked.rs | 9 +++------
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
index 3991ba0..3be1eb1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -32,4 +32,4 @@ features = ["serde", "v4"]
[dev-dependencies]
quickcheck = "0.6"
-loopdev = "0.1.1"
+loopdev = "0.2"
diff --git a/src/engine/strat_engine/tests/loopbacked.rs b/src/engine/strat_engine/tests/loopbacked.rs
index 129c4ca..8d92c55 100644
--- a/src/engine/strat_engine/tests/loopbacked.rs
+++ b/src/engine/strat_engine/tests/loopbacked.rs
@@ -50,12 +50,9 @@ impl LoopTestDev {
f.flush().unwrap();
let ld = lc.next_free().unwrap();
- ld.attach(path, 0).unwrap();
+ ld.attach_file(path).unwrap();
// Wipe 1 MiB at the beginning, as data sits around on the files.
- wipe_sectors(&ld.get_path().unwrap(),
- Sectors(0),
- Bytes(IEC::Mi).sectors())
- .unwrap();
+ wipe_sectors(&ld.path().unwrap(), Sectors(0), Bytes(IEC::Mi).sectors()).unwrap();
LoopTestDev { ld: ld }
}
@@ -104,7 +101,7 @@ pub fn test_with_spec<F>(limits: DeviceLimits, test: F) -> ()
let loop_devices: Vec<LoopTestDev> = get_devices(count, &tmpdir);
let device_paths: Vec<PathBuf> = loop_devices
.iter()
- .map(|x| x.ld.get_path().unwrap())
+ .map(|x| x.ld.path().unwrap())
.collect();
let device_paths: Vec<&Path> = device_paths.iter().map(|x| x.as_path()).collect();
--
2.15.1

View File

@ -1 +1 @@
SHA512 (stratisd-0.1.4.tar.gz) = 8a80ea4810d54ff1288869df6a8ead932304fb5d6eda434a051319ebb129f9d710ec939c6150b16c75823794c6bc68f2d39ef8fbceb62bf90a6bab6d13543182
SHA512 (stratisd-0.1.5.tar.gz) = 832e8cefc73866baa76817d60426581b289064598e2adf5dd9fd00cc8c78dba3d612e8c8d89015cb64e559207e34ed03af48c13918e550adcb76fc2e01306fa5

View File

@ -1,13 +1,15 @@
# Generated by rust2rpm
%bcond_without check
# Not interested in packaging lib
# stratisd is supposed to be daemon used through dbus
%global __cargo_is_lib() false
# We want to support dbus
%global __cargo_common_opts %{__cargo_common_opts} --features dbus_enabled
Name: stratisd
Version: 0.1.4
Release: 4%{?dist}
Version: 0.1.5
Release: 1%{?dist}
Summary: Daemon that manages block devices to create filesystems
License: MPLv2.0
@ -33,7 +35,7 @@ BuildRequires: (crate(chrono) >= 0.4.0 with crate(chrono) < 0.5.0)
BuildRequires: (crate(clap) >= 2.0.0 with crate(clap) < 3.0.0)
BuildRequires: (crate(crc) >= 1.0.0 with crate(crc) < 2.0.0)
BuildRequires: (crate(dbus) >= 0.6.1 with crate(dbus) < 0.7.0)
BuildRequires: (crate(devicemapper) >= 0.15.0 with crate(devicemapper) < 0.16.0)
BuildRequires: (crate(devicemapper) >= 0.16.0 with crate(devicemapper) < 0.17.0)
BuildRequires: (crate(env_logger) >= 0.4.0 with crate(env_logger) < 0.5.0)
BuildRequires: (crate(error-chain) >= 0.11.0 with crate(error-chain) < 0.12.0)
BuildRequires: (crate(libc) >= 0.2.0 with crate(libc) < 0.3.0)
@ -47,7 +49,6 @@ BuildRequires: (crate(serde) >= 1.0.0 with crate(serde) < 2.0.0)
BuildRequires: (crate(serde_derive) >= 1.0.0 with crate(serde_derive) < 2.0.0)
BuildRequires: (crate(serde_json) >= 1.0.0 with crate(serde_json) < 2.0.0)
BuildRequires: (crate(tempdir) >= 0.3.5 with crate(tempdir) < 0.4.0)
BuildRequires: (crate(term) >= 0.4.0 with crate(term) < 0.5.0)
BuildRequires: ((crate(uuid) >= 0.5.0 with crate(uuid) < 0.6.0) with crate(uuid/serde) with crate(uuid/v4))
%if %{with check}
# [dev-dependencies]
@ -88,6 +89,9 @@ mv %{buildroot}%{_bindir}/stratisd %{buildroot}%{_libexecdir}/stratisd
%{_datadir}/dbus-1/system-services/org.storage.stratis1.service
%changelog
* Sun Feb 11 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.1.5-1
- Update to 0.1.5
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild