Skip to contentSkip to conversation

generic/694: sync before sampling i_blocks

PATCH In review Christoph Hellwig 3 participants 4 messages Oct 8, 2024 – Oct 10, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/694: sync before sampling i_blocks

Without a sync there might still be temporary blocks in i_blocks like indirect block reservations or additional blocks reserved for out of place writes.

---
 tests/generic/694 | 4 ++++
 1 file changed, 4 insertions(+)
tests/generic/694 +4 -0
index 02253ef75..b6bc8a75f 100755
@@ -37,6 +37,10 @@ if [ $? -ne 0 ]; then
 	echo "Could not create 4G test file"
 fi
 
+# make sure indirect block reservations and other temporary block reservations
+# are release before sampling i_blocks
+sync
+
 iblocks=`stat -c '%b' $junk_file`
 
 _test_cycle_mount
Signature · 1 line
2.45.2
#1 lore raw
Quoted 14 lines · Christoph Hellwig

Without a sync there might still be temporary blocks in i_blocks like indirect block reservations or additional blocks reserved for out of place writes.

---
 tests/generic/694 | 4 ++++
 1 file changed, 4 insertions(+)
tests/generic/694 +0 -0
index 02253ef75..b6bc8a75f 100755

tests/generic/694 if [ $? -ne 0 ]; then · line 41

Quoted 5 lines
tests/generic/694 +2 -0
@@ -37,6 +37,10 @@ if [ $? -ne 0 ]; then
 	echo "Could not create 4G test file"
 fi
 
+# make sure indirect block reservations and other temporary block reservations
+# are release before sampling i_blocks

Nit: '...are released before...'

tests/generic/694 if [ $? -ne 0 ]; then · line 42

Quoted 1 line
tests/generic/694 +1 -0
+sync

Should this be more targeted since we only care about junk_file's i_blocks, not flushing everything in the system. e.g.

sync $junk_file

--D

Quoted 8 lines
tests/generic/694 +1 -0
+
 iblocks=`stat -c '%b' $junk_file`
 
 _test_cycle_mount
Signature · 1 line
2.45.2
#2 lore raw
Quoted 23 lines · Darrick J. Wong
Quoted 14 lines · Christoph Hellwig

Without a sync there might still be temporary blocks in i_blocks like indirect block reservations or additional blocks reserved for out of place writes.

---
 tests/generic/694 | 4 ++++
 1 file changed, 4 insertions(+)
tests/generic/694 +0 -0
index 02253ef75..b6bc8a75f 100755

tests/generic/694 if [ $? -ne 0 ]; then · line 41

Quoted 5 lines
tests/generic/694 +2 -0
@@ -37,6 +37,10 @@ if [ $? -ne 0 ]; then
 	echo "Could not create 4G test file"
 fi
 
+# make sure indirect block reservations and other temporary block reservations
+# are release before sampling i_blocks

Nit: '...are released before...'

Quoted 6 lines

tests/generic/694 if [ $? -ne 0 ]; then · line 42

Quoted 1 line
tests/generic/694 +1 -0
+sync

Should this be more targeted since we only care about junk_file's i_blocks, not flushing everything in the system. e.g.

sync $junk_file

I can help to do this change, if you don't have more review points besides that.

Thanks,
Zorro

Quoted 12 lines

--D

Quoted 8 lines
tests/generic/694 +1 -0
+
 iblocks=`stat -c '%b' $junk_file`
 
 _test_cycle_mount
Signature · 1 line
2.45.2
#3 lore raw
In reply to Darrick J. Wong
Quoted 11 lines · Darrick J. Wong

tests/generic/694 if [ $? -ne 0 ]; then · line 41

Quoted 2 lines
tests/generic/694 +2 -0
+# make sure indirect block reservations and other temporary block reservations
+# are release before sampling i_blocks

Nit: '...are released before...'

Quoted 1 line

+sync

Should this be more targeted since we only care about junk_file's i_blocks, not flushing everything in the system. e.g.

sync $junk_file

I didn't even know sync took an optional file argument. But yes, that should be fine.