generic/694: sync before sampling i_blocks
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
@@ -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
Quoted 14 lines · Christoph Hellwig
Without a sync there might still be temporary blocks in
i_blockslike indirect block reservations or additional blocks reserved for out of place writes.Signed-off-by Christoph Hellwig <[email protected]>--- tests/generic/694 | 4 ++++ 1 file changed, 4 insertions(+)tests/generic/694 +0
-0
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_mountSignature · 1 line
2.45.2
Quoted 23 lines · Darrick J. Wong
Quoted 14 lines · Christoph Hellwig
Without a sync there might still be temporary blocks in
i_blockslike indirect block reservations or additional blocks reserved for out of place writes.Signed-off-by Christoph Hellwig <[email protected]>--- tests/generic/694 | 4 ++++ 1 file changed, 4 insertions(+)tests/generic/694 +0
-0tests/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_blocksNit: '...are released before...'
Quoted 6 lines
tests/generic/694 if [ $? -ne 0 ]; then · line 42
Quoted 1 line
tests/generic/694 +1
-0+syncShould 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_mountSignature · 1 line
2.45.2
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_blocksNit: '...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.