From 9458118a591f7a64e8e352df1079b4453d19d877 Mon Sep 17 00:00:00 2001 From: mulhern Date: Mon, 6 May 2024 13:42:45 -0400 Subject: [PATCH 1/5] Revert "test_fs_size_limit: Run fs_check after increasing limit" This reverts commit c6bd0c54b6d8e4afefe46ba9ba79d694e28cc03a. --- src/engine/strat_engine/thinpool/thinpool.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/engine/strat_engine/thinpool/thinpool.rs b/src/engine/strat_engine/thinpool/thinpool.rs index 00471d88ae..de67bb0755 100644 --- a/src/engine/strat_engine/thinpool/thinpool.rs +++ b/src/engine/strat_engine/thinpool/thinpool.rs @@ -2641,6 +2641,13 @@ mod tests { let (_, fs) = pool.get_mut_filesystem_by_uuid(fs_uuid).unwrap(); assert_eq!(fs.size_limit(), Some(Sectors(1600 * IEC::Ki))); } + let mut bytes_written = Bytes(0); + // Write 100 * IEC::Mi + while bytes_written < Bytes::from(100 * IEC::Mi) { + file.write_all(&[1; 4096]).unwrap(); + bytes_written += Bytes(4096); + } + file.sync_all().unwrap(); pool.check_fs(pool_uuid, &backstore).unwrap(); { From 90ca9d732a43d8fd25993ca2ae43a2662f00f078 Mon Sep 17 00:00:00 2001 From: mulhern Date: Mon, 6 May 2024 13:44:27 -0400 Subject: [PATCH 2/5] Run tests on f40 Signed-off-by: mulhern --- .github/workflows/fedora.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fedora.yml b/.github/workflows/fedora.yml index 43886b33f3..adb77f9534 100644 --- a/.github/workflows/fedora.yml +++ b/.github/workflows/fedora.yml @@ -82,7 +82,7 @@ jobs: components: cargo runs-on: ubuntu-22.04 container: - image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:40 # CURRENT DEVELOPMENT ENVIRONMENT options: --privileged -v /dev:/dev -v /run/udev:/run/udev -v /usr/lib/udev:/usr/lib/udev steps: - uses: actions/checkout@v4 @@ -117,7 +117,7 @@ jobs: components: cargo runs-on: ubuntu-22.04 container: - image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT + image: fedora:40 # CURRENT DEVELOPMENT ENVIRONMENT options: --privileged -v /dev:/dev -v /run/udev:/run/udev -v /usr/lib/udev:/usr/lib/udev --ipc=host steps: - uses: actions/checkout@v4 From 8175eedc02e1bc1bce961496764a5be155b84d02 Mon Sep 17 00:00:00 2001 From: mulhern Date: Mon, 6 May 2024 15:41:47 -0400 Subject: [PATCH 3/5] What happens if we write fewer bytes before check Signed-off-by: mulhern --- src/engine/strat_engine/thinpool/thinpool.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/strat_engine/thinpool/thinpool.rs b/src/engine/strat_engine/thinpool/thinpool.rs index de67bb0755..c330f0bbea 100644 --- a/src/engine/strat_engine/thinpool/thinpool.rs +++ b/src/engine/strat_engine/thinpool/thinpool.rs @@ -2643,7 +2643,7 @@ mod tests { } let mut bytes_written = Bytes(0); // Write 100 * IEC::Mi - while bytes_written < Bytes::from(100 * IEC::Mi) { + while bytes_written < Bytes::from(50 * IEC::Mi) { file.write_all(&[1; 4096]).unwrap(); bytes_written += Bytes(4096); } From ee6f50a88aa9f6d9d0e5d935ffd730d925e67be5 Mon Sep 17 00:00:00 2001 From: mulhern Date: Mon, 6 May 2024 16:58:59 -0400 Subject: [PATCH 4/5] Revert "What happens if we write fewer bytes before check" This reverts commit 8175eedc02e1bc1bce961496764a5be155b84d02. --- src/engine/strat_engine/thinpool/thinpool.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/strat_engine/thinpool/thinpool.rs b/src/engine/strat_engine/thinpool/thinpool.rs index c330f0bbea..de67bb0755 100644 --- a/src/engine/strat_engine/thinpool/thinpool.rs +++ b/src/engine/strat_engine/thinpool/thinpool.rs @@ -2643,7 +2643,7 @@ mod tests { } let mut bytes_written = Bytes(0); // Write 100 * IEC::Mi - while bytes_written < Bytes::from(50 * IEC::Mi) { + while bytes_written < Bytes::from(100 * IEC::Mi) { file.write_all(&[1; 4096]).unwrap(); bytes_written += Bytes(4096); } From 1b38e000d1c652072d9625c71b988eabae53aa79 Mon Sep 17 00:00:00 2001 From: mulhern Date: Mon, 6 May 2024 17:06:00 -0400 Subject: [PATCH 5/5] Double the size of everything Expect this to pass Signed-off-by: mulhern --- src/engine/strat_engine/thinpool/thinpool.rs | 30 ++++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/engine/strat_engine/thinpool/thinpool.rs b/src/engine/strat_engine/thinpool/thinpool.rs index de67bb0755..7ce651d8b5 100644 --- a/src/engine/strat_engine/thinpool/thinpool.rs +++ b/src/engine/strat_engine/thinpool/thinpool.rs @@ -2590,14 +2590,14 @@ mod tests { pool_name, pool_uuid, "stratis_test_filesystem", - Sectors::from(1200 * IEC::Ki), - // 700 * IEC::Mi - Some(Sectors(1400 * IEC::Ki)), + Sectors::from(2400 * IEC::Ki), + // 1400 * IEC::Mi + Some(Sectors(2800 * IEC::Ki)), ) .unwrap(); let devnode = { let (_, fs) = pool.get_mut_filesystem_by_uuid(fs_uuid).unwrap(); - assert_eq!(fs.size_limit(), Some(Sectors(1400 * IEC::Ki))); + assert_eq!(fs.size_limit(), Some(Sectors(2800 * IEC::Ki))); fs.devnode() }; @@ -2621,8 +2621,8 @@ mod tests { .open(new_file) .unwrap(); let mut bytes_written = Bytes(0); - // Write 400 * IEC::Mi - while bytes_written < Bytes::from(400 * IEC::Mi) { + // Write 800 * IEC::Mi + while bytes_written < Bytes::from(800 * IEC::Mi) { file.write_all(&[1; 4096]).unwrap(); bytes_written += Bytes(4096); } @@ -2634,16 +2634,16 @@ mod tests { assert_eq!(fs.size_limit(), Some(fs.size().sectors())); } - // 800 * IEC::Mi - pool.set_fs_size_limit(fs_uuid, Some(Sectors(1600 * IEC::Ki))) + // 1600 * IEC::Mi + pool.set_fs_size_limit(fs_uuid, Some(Sectors(3200 * IEC::Ki))) .unwrap(); { let (_, fs) = pool.get_mut_filesystem_by_uuid(fs_uuid).unwrap(); - assert_eq!(fs.size_limit(), Some(Sectors(1600 * IEC::Ki))); + assert_eq!(fs.size_limit(), Some(Sectors(3200 * IEC::Ki))); } let mut bytes_written = Bytes(0); - // Write 100 * IEC::Mi - while bytes_written < Bytes::from(100 * IEC::Mi) { + // Write 200 * IEC::Mi + while bytes_written < Bytes::from(200 * IEC::Mi) { file.write_all(&[1; 4096]).unwrap(); bytes_written += Bytes(4096); } @@ -2659,7 +2659,7 @@ mod tests { let (_, fs) = pool .snapshot_filesystem(pool_name, pool_uuid, fs_uuid, "snapshot") .unwrap(); - assert_eq!(fs.size_limit(), Some(Sectors(1600 * IEC::Ki))); + assert_eq!(fs.size_limit(), Some(Sectors(3200 * IEC::Ki))); } pool.set_fs_size_limit(fs_uuid, None).unwrap(); @@ -2668,8 +2668,8 @@ mod tests { assert_eq!(fs.size_limit(), None); } let mut bytes_written = Bytes(0); - // Write 200 * IEC::Mi - while bytes_written < Bytes::from(200 * IEC::Mi) { + // Write 400 * IEC::Mi + while bytes_written < Bytes::from(400 * IEC::Mi) { file.write_all(&[1; 4096]).unwrap(); bytes_written += Bytes(4096); } @@ -2678,7 +2678,7 @@ mod tests { { let (_, fs) = pool.get_mut_filesystem_by_uuid(fs_uuid).unwrap(); - assert_eq!(fs.size().sectors(), Sectors(3200 * IEC::Ki)); + assert_eq!(fs.size().sectors(), Sectors(6400 * IEC::Ki)); } assert!(pool.set_fs_size_limit(fs_uuid, Some(Sectors(50))).is_err());