Skip to contentSkip to conversation

tools/mvtest: call out to the correct group sort program

PATCH In review Darrick J. Wong 2 participants 8 messages Jan 23, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 tools/mvtest: call out to the correct group sort program

mvtest should call the actual name of the sort-group program. Fix a cut-paste error in finding the destination group file.

---
 tools/mvtest |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/mvtest +2 -2
index af601d6..20bc23e 100755
@@ -33,7 +33,7 @@ sgroup="$(basename "$(dirname "tests/${src}")")"
 dgroup="$(basename "$(dirname "tests/${dest}")")"
 
 sgroupfile="tests/${sgroup}/group"
-dgroupfile="tests/${sgroup}/group"
+dgroupfile="tests/${dgroup}/group"
 
 git mv "tests/${src}" "tests/${dest}"
 git mv "tests/${src}.out" "tests/${dest}.out"
@@ -47,7 +47,7 @@ newgrpline="$(echo "${grpline}" | sed -e "s/^${sid} /${did} /g")"
 sed -e "/^${sid}.*$/d" -i "${sgroupfile}"
 cp "${dgroupfile}" "${dgroupfile}.new"
 append "${dgroupfile}.new" "${newgrpline}"
-"${dir}/sort-group.py" "${dgroupfile}.new"
+"${dir}/sort-group" "${dgroupfile}.new"
 mv "${dgroupfile}.new" "${dgroupfile}"
 
 echo "Moved \"${src}\" to \"${dest}\"."
#1 lore raw

PATCH 2/5 reflink: fix off-by-one errors when iterating file blocks in a loop

When we're iterating file blocks in a loop (via seq), we have to end at $nr-1, not $nr.

---
 tests/generic/183 |    2 +-
 tests/generic/185 |    2 +-
 tests/generic/186 |    2 +-
 tests/generic/187 |    2 +-
 tests/generic/194 |    2 +-
 tests/generic/195 |    2 +-
 tests/xfs/129     |    6 +++---
 tests/xfs/140     |    2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)
tests/generic/183 +1 -1
index 5c65e9a..2cf9ce4 100755
@@ -69,7 +69,7 @@ seq 0 2 $((NR-1)) | while read f; do
 	_reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
 	_pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
 	_reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
 	_pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/185 +1 -1
index 384c9aa..55c54ac 100755
@@ -69,7 +69,7 @@ seq 0 2 $((NR-1)) | while read f; do
 	_reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
 	_pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
 	_reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
 	_pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/186 +1 -1
index d84166d..f1c0e6b 100755
@@ -112,7 +112,7 @@ seq 0 2 $((NR-1)) | while read f; do
 	_reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
 	_pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
 	_reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
 	_pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/187 +1 -1
index c85a0a9..ce35ec0 100755
@@ -112,7 +112,7 @@ seq 0 2 $((NR-1)) | while read f; do
 	_reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
 	_pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
 	_reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
 	_pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/194 +1 -1
index a441aee..b88297e 100755
@@ -79,7 +79,7 @@ md5sum "$TESTDIR/file3" | _filter_scratch
 md5sum "$TESTDIR/file3.chk" | _filter_scratch
 
 echo "directio CoW across the transition"
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
 	_pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3" >> "$seqres.full"
 	_pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/195 +1 -1
index 83e7b23..464a4d4 100755
@@ -79,7 +79,7 @@ md5sum "$TESTDIR/file3" | _filter_scratch
 md5sum "$TESTDIR/file3.chk" | _filter_scratch
 
 echo "CoW across the transition"
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
 	_pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3" >> "$seqres.full"
 	_pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/xfs/129 +3 -3
index c8c47a2..3b7c59c 100755
@@ -65,9 +65,9 @@ NR_BLKS=$((4 * BLKSZ / 12))
 _pwrite_byte 0x61 0 $((BLKSZ * NR_BLKS)) "$TESTDIR/file1" >> "$seqres.full"
 
 echo "Reflink every other block"
-seq 1 $((NR_BLKS / 2)) | while read nr; do
-	_reflink_range  "$TESTDIR/file1" $((nr * 2 * BLKSZ)) \
-			"$TESTDIR/file2" $((nr * 2 * BLKSZ)) $BLKSZ >> "$seqres.full"
+seq 1 2 $((NR_BLKS - 1)) | while read nr; do
+	_reflink_range  "$TESTDIR/file1" $((nr * BLKSZ)) \
+			"$TESTDIR/file2" $((nr * BLKSZ)) $BLKSZ >> "$seqres.full"
 done
 
 echo "Create metadump file"
tests/xfs/140 +1 -1
index e20cd3f..45be9f4 100644
@@ -70,7 +70,7 @@ cmp -s "$TESTDIR/file1" "$TESTDIR/file2" || echo "file1 and file2 do not match"
 cmp -s "$TESTDIR/file2" "$TESTDIR/file2.chk" || echo "file2 and file2.chk do not match"
 
 echo "CoW every other block"
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR - 1)) | while read f; do
 	_pwrite_byte 0x62 $((f * BLKSZ)) $BLKSZ "$TESTDIR/file2" >> "$seqres.full"
 	_pwrite_byte 0x62 $((f * BLKSZ)) $BLKSZ "$TESTDIR/file2.chk" >> "$seqres.full"
 done
#2 lore raw

Re: [PATCH 2/5] reflink: fix off-by-one errors when iterating file blocks in a loop

Quoted 21 lines · Darrick J. Wong

When we're iterating file blocks in a loop (via seq), we have to end at $nr-1, not $nr.

---
 tests/generic/183 |    2 +-
 tests/generic/185 |    2 +-
 tests/generic/186 |    2 +-
 tests/generic/187 |    2 +-
 tests/generic/194 |    2 +-
 tests/generic/195 |    2 +-
 tests/xfs/129     |    6 +++---
 tests/xfs/140     |    2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)
tests/generic/183 +0 -0
index 5c65e9a..2cf9ce4 100755

tests/generic/183 seq 0 2 $((NR-1)) | while read f; do · line 72

Quoted 5 lines
tests/generic/183 +1 -1
@@ -69,7 +69,7 @@ seq 0 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do

Just curious (and no bike shedding intended), why not make the loop in a much more simple and common way such as:

for ((i = 1; i < $NR; i += 2)); do
...
done

or for i in seq 1 2 $((NR - 1)); do .... done

Quoted 103 lines
tests/generic/183 +0 -0
        _reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/185 +1 -1
index 384c9aa..55c54ac 100755
@@ -69,7 +69,7 @@ seq 0 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/186 +1 -1
index d84166d..f1c0e6b 100755
@@ -112,7 +112,7 @@ seq 0 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/187 +1 -1
index c85a0a9..ce35ec0 100755
@@ -112,7 +112,7 @@ seq 0 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/194 +1 -1
index a441aee..b88297e 100755
@@ -79,7 +79,7 @@ md5sum "$TESTDIR/file3" | _filter_scratch
 md5sum "$TESTDIR/file3.chk" | _filter_scratch
 
 echo "directio CoW across the transition"
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3" >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/195 +1 -1
index 83e7b23..464a4d4 100755
@@ -79,7 +79,7 @@ md5sum "$TESTDIR/file3" | _filter_scratch
 md5sum "$TESTDIR/file3.chk" | _filter_scratch
 
 echo "CoW across the transition"
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3" >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/xfs/129 +3 -3
index c8c47a2..3b7c59c 100755
@@ -65,9 +65,9 @@ NR_BLKS=$((4 * BLKSZ / 12))
 _pwrite_byte 0x61 0 $((BLKSZ * NR_BLKS)) "$TESTDIR/file1" >> "$seqres.full"
 
 echo "Reflink every other block"
-seq 1 $((NR_BLKS / 2)) | while read nr; do
-       _reflink_range  "$TESTDIR/file1" $((nr * 2 * BLKSZ)) \
-                       "$TESTDIR/file2" $((nr * 2 * BLKSZ)) $BLKSZ >> "$seqres.full"
+seq 1 2 $((NR_BLKS - 1)) | while read nr; do
+       _reflink_range  "$TESTDIR/file1" $((nr * BLKSZ)) \
+                       "$TESTDIR/file2" $((nr * BLKSZ)) $BLKSZ >> "$seqres.full"
 done
 
 echo "Create metadump file"
tests/xfs/140 +1 -2
index e20cd3f..45be9f4 100644
@@ -70,7 +70,7 @@ cmp -s "$TESTDIR/file1" "$TESTDIR/file2" || echo "file1 and file2 do not match"
 cmp -s "$TESTDIR/file2" "$TESTDIR/file2.chk" || echo "file2 and file2.chk do not match"
 
 echo "CoW every other block"
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR - 1)) | while read f; do
        _pwrite_byte 0x62 $((f * BLKSZ)) $BLKSZ "$TESTDIR/file2" >> "$seqres.full"
        _pwrite_byte 0x62 $((f * BLKSZ)) $BLKSZ "$TESTDIR/file2.chk" >> "$seqres.full"
 done
 
--

To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 5 lines
Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."
#3 lore raw

Re: [PATCH 2/5] reflink: fix off-by-one errors when iterating file blocks in a loop

Quoted 32 lines · Filipe Manana
Quoted 21 lines · Darrick J. Wong

When we're iterating file blocks in a loop (via seq), we have to end at $nr-1, not $nr.

---
 tests/generic/183 |    2 +-
 tests/generic/185 |    2 +-
 tests/generic/186 |    2 +-
 tests/generic/187 |    2 +-
 tests/generic/194 |    2 +-
 tests/generic/195 |    2 +-
 tests/xfs/129     |    6 +++---
 tests/xfs/140     |    2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)
tests/generic/183 +0 -0
index 5c65e9a..2cf9ce4 100755

tests/generic/183 seq 0 2 $((NR-1)) | while read f; do · line 72

Quoted 5 lines
tests/generic/183 +1 -1
@@ -69,7 +69,7 @@ seq 0 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do

Just curious (and no bike shedding intended), why not make the loop in a much more simple and common way such as:

Quoted 3 lines

for ((i = 1; i < $NR; i += 2)); do
...
done

Not that it matters here, but that's a bashism, isn't it?

Quoted 1 line

or for i in seq 1 2 $((NR - 1)); do .... done

<shrug> No particular reason. :)

I suppose if NR is large then "seq | while read" avoids spraying a large number of arguments into the command interpreter, though that clearly isn't the case here.

--D

Quoted 102 lines
Quoted 102 lines
tests/generic/183 +0 -0
        _reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/185 +1 -1
index 384c9aa..55c54ac 100755
@@ -69,7 +69,7 @@ seq 0 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/186 +1 -1
index d84166d..f1c0e6b 100755
@@ -112,7 +112,7 @@ seq 0 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/187 +1 -1
index c85a0a9..ce35ec0 100755
@@ -112,7 +112,7 @@ seq 0 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/194 +1 -1
index a441aee..b88297e 100755
@@ -79,7 +79,7 @@ md5sum "$TESTDIR/file3" | _filter_scratch
 md5sum "$TESTDIR/file3.chk" | _filter_scratch
 
 echo "directio CoW across the transition"
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3" >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/195 +1 -1
index 83e7b23..464a4d4 100755
@@ -79,7 +79,7 @@ md5sum "$TESTDIR/file3" | _filter_scratch
 md5sum "$TESTDIR/file3.chk" | _filter_scratch
 
 echo "CoW across the transition"
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3" >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/xfs/129 +3 -3
index c8c47a2..3b7c59c 100755
@@ -65,9 +65,9 @@ NR_BLKS=$((4 * BLKSZ / 12))
 _pwrite_byte 0x61 0 $((BLKSZ * NR_BLKS)) "$TESTDIR/file1" >> "$seqres.full"
 
 echo "Reflink every other block"
-seq 1 $((NR_BLKS / 2)) | while read nr; do
-       _reflink_range  "$TESTDIR/file1" $((nr * 2 * BLKSZ)) \
-                       "$TESTDIR/file2" $((nr * 2 * BLKSZ)) $BLKSZ >> "$seqres.full"
+seq 1 2 $((NR_BLKS - 1)) | while read nr; do
+       _reflink_range  "$TESTDIR/file1" $((nr * BLKSZ)) \
+                       "$TESTDIR/file2" $((nr * BLKSZ)) $BLKSZ >> "$seqres.full"
 done
 
 echo "Create metadump file"
tests/xfs/140 +1 -1
index e20cd3f..45be9f4 100644
@@ -70,7 +70,7 @@ cmp -s "$TESTDIR/file1" "$TESTDIR/file2" || echo "file1 and file2 do not match"
 cmp -s "$TESTDIR/file2" "$TESTDIR/file2.chk" || echo "file2 and file2.chk do not match"
 
 echo "CoW every other block"
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR - 1)) | while read f; do
        _pwrite_byte 0x62 $((f * BLKSZ)) $BLKSZ "$TESTDIR/file2" >> "$seqres.full"
        _pwrite_byte 0x62 $((f * BLKSZ)) $BLKSZ "$TESTDIR/file2.chk" >> "$seqres.full"
 done
Quoted 13 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 5 lines
Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#4 lore raw

Re: [PATCH 2/5] reflink: fix off-by-one errors when iterating file blocks in a loop

Quoted 33 lines · Darrick J. Wong
Quoted 32 lines · Filipe Manana
Quoted 21 lines · Darrick J. Wong

When we're iterating file blocks in a loop (via seq), we have to end at $nr-1, not $nr.

---
 tests/generic/183 |    2 +-
 tests/generic/185 |    2 +-
 tests/generic/186 |    2 +-
 tests/generic/187 |    2 +-
 tests/generic/194 |    2 +-
 tests/generic/195 |    2 +-
 tests/xfs/129     |    6 +++---
 tests/xfs/140     |    2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)
tests/generic/183 +0 -0
index 5c65e9a..2cf9ce4 100755

tests/generic/183 seq 0 2 $((NR-1)) | while read f; do · line 72

Quoted 5 lines
tests/generic/183 +1 -1
@@ -69,7 +69,7 @@ seq 0 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do

Just curious (and no bike shedding intended), why not make the loop in a much more simple and common way such as:

Quoted 5 lines
Quoted 3 lines

for ((i = 1; i < $NR; i += 2)); do
...
done

Not that it matters here, but that's a bashism, isn't it?

Yep, but all tests and scripts (./check, common/rc, etc) start with a shebang referring to bash.

Quoted 8 lines
Quoted 2 lines

or for i in seq 1 2 $((NR - 1)); do .... done

<shrug> No particular reason. :)

I suppose if NR is large then "seq | while read" avoids spraying a large number of arguments into the command interpreter, though that clearly isn't the case here.

Right.
Thanks.

Quoted 118 lines

--D

Quoted 115 lines
Quoted 103 lines
tests/generic/183 +0 -0
        _reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/185 +1 -1
index 384c9aa..55c54ac 100755
@@ -69,7 +69,7 @@ seq 0 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/186 +1 -1
index d84166d..f1c0e6b 100755
@@ -112,7 +112,7 @@ seq 0 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/187 +1 -1
index c85a0a9..ce35ec0 100755
@@ -112,7 +112,7 @@ seq 0 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file1" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x61 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _reflink_range "$TESTDIR/file2" $((BLKSZ * f)) "$TESTDIR/file3" $((BLKSZ * f)) $BLKSZ >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/194 +1 -1
index a441aee..b88297e 100755
@@ -79,7 +79,7 @@ md5sum "$TESTDIR/file3" | _filter_scratch
 md5sum "$TESTDIR/file3.chk" | _filter_scratch
 
 echo "directio CoW across the transition"
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3" >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/generic/195 +1 -1
index 83e7b23..464a4d4 100755
@@ -79,7 +79,7 @@ md5sum "$TESTDIR/file3" | _filter_scratch
 md5sum "$TESTDIR/file3.chk" | _filter_scratch
 
 echo "CoW across the transition"
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR-1)) | while read f; do
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3" >> "$seqres.full"
        _pwrite_byte 0x62 $((BLKSZ * f)) $BLKSZ "$TESTDIR/file3.chk" >> "$seqres.full"
 done
tests/xfs/129 +3 -3
index c8c47a2..3b7c59c 100755
@@ -65,9 +65,9 @@ NR_BLKS=$((4 * BLKSZ / 12))
 _pwrite_byte 0x61 0 $((BLKSZ * NR_BLKS)) "$TESTDIR/file1" >> "$seqres.full"
 
 echo "Reflink every other block"
-seq 1 $((NR_BLKS / 2)) | while read nr; do
-       _reflink_range  "$TESTDIR/file1" $((nr * 2 * BLKSZ)) \
-                       "$TESTDIR/file2" $((nr * 2 * BLKSZ)) $BLKSZ >> "$seqres.full"
+seq 1 2 $((NR_BLKS - 1)) | while read nr; do
+       _reflink_range  "$TESTDIR/file1" $((nr * BLKSZ)) \
+                       "$TESTDIR/file2" $((nr * BLKSZ)) $BLKSZ >> "$seqres.full"
 done
 
 echo "Create metadump file"
tests/xfs/140 +1 -2
index e20cd3f..45be9f4 100644
@@ -70,7 +70,7 @@ cmp -s "$TESTDIR/file1" "$TESTDIR/file2" || echo "file1 and file2 do not match"
 cmp -s "$TESTDIR/file2" "$TESTDIR/file2.chk" || echo "file2 and file2.chk do not match"
 
 echo "CoW every other block"
-seq 1 2 $NR | while read f; do
+seq 1 2 $((NR - 1)) | while read f; do
        _pwrite_byte 0x62 $((f * BLKSZ)) $BLKSZ "$TESTDIR/file2" >> "$seqres.full"
        _pwrite_byte 0x62 $((f * BLKSZ)) $BLKSZ "$TESTDIR/file2.chk" >> "$seqres.full"
 done
 
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Filipe David Manana,

"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves. That's why all progress depends on unreasonable men."

Signature · 5 lines
Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."
#5 lore raw

PATCH 3/5 xfs/122: update against xfsprogs 4.3

In reply to Darrick J. Wong

Make the xfsprogs sb layout and structure size checker work with modern xfsprogs (i.e. 4.3+ and all the new v5 stuff). The old test wasn't picking up structures because they're no longer defined in the "typedef struct xfs_foo { } xfs_foo_t;" style.

---
 tests/xfs/122     |   29 +++++-
 tests/xfs/122.out |  265 +++++++++++++++++++++++++++++------------------------
 2 files changed, 166 insertions(+), 128 deletions(-)
tests/xfs/122 +23 -6
index 682ffb4..e6697a2 100755
@@ -74,10 +74,22 @@ progout=$tmp.output
 
 cat >$cprog <<EOF
 #include <stdio.h>
-#include <xfs/libxlog.h>
 EOF
+for hdr in /usr/include/xfs/xfs*.h; do
+	echo "#include <$(echo "$hdr" | sed -e 's|/usr/include/||g')>" >> $cprog
+done
+
+# missing:
+# xfs_attr_shortform_t
+# xfs_trans_header_t
 
 cat >$tmp.ignore <<EOF
+xfs_buf_log_format_t
+xfs_attr3_icleaf_hdr
+xfs_da3_icnode_hdr
+xfs_dir3_icfree_hdr
+xfs_dir3_icleaf_hdr
+xfs_name
 xfs_alloctype_t
 xfs_buf_cancel_t
 xfs_bmbt_rec_32_t
@@ -177,11 +189,16 @@ echo 'int main(int argc, char *argv[]) {' >>$cprog
 #
 cat /usr/include/xfs/xfs*.h | indent |\
 _attribute_filter |\
-tee $seqres.full |\
-egrep '} *xfs_.*_t' |\
+egrep '(} *xfs_.*_t|^struct xfs_[a-z0-9_]*$)' > /tmp/barf
+
+cat /usr/include/xfs/xfs*.h | indent |\
+_attribute_filter |\
+egrep '(} *xfs_.*_t|^struct xfs_[a-z0-9_]*$)' |\
 egrep -v -f $tmp.ignore |\
-awk '{sub(/[;,]/,"",$2); print "printf(\"sizeof(", $2, ") = %d\\n\", sizeof(", $2, "));"}' \
->>$cprog
+sed -e 's/^.*}[[:space:]]*//g' -e 's/;.*$//g' -e 's/_t, /_t\n/g' |\
+sort | uniq |\
+awk '{printf("printf(\"sizeof(%s) = \\%zu\\n\", sizeof(%s));\n", $0, $0);}' |\
+cat >> $cprog
 
 #
 # Look at offsets of key ones which differ in lengths
@@ -192,7 +209,7 @@ cat /usr/include/xfs/xfs*.h | indent |\
 awk '
    /typedef struct xfs_sb/ { structon = 1; next }
    structon && $2 ~ /^sb_/ { sub(/[;,]/,"",$2)
-                             print "printf(\"offsetof(xfs_sb_t,", $2, ") = %d\\n\", offsetof(xfs_sb_t,", $2, "));"; next}
+                             printf("printf(\"offsetof(xfs_sb_t, %s) = \\%zu\\n\", offsetof(xfs_sb_t, %s));", $2, $2); next}
    structon && /}/ { structon = 0; next}
 '>>$cprog
 
tests/xfs/122.out +143 -122

266 lines not on this page · raw message

#6 lore raw

PATCH 4/5 dedupe: record dedupe errors in golden output

In reply to Darrick J. Wong

The xfs_io dedupe command originally didn't print dedupe errors to stderr like you'd expect. Since that was fixed, the golden output should be changed to reflect that.

---
 tests/generic/122.out |    1 +
 tests/generic/136     |    2 ++
 tests/generic/136.out |    3 +++
 tests/generic/137     |    2 +-
 tests/generic/182.out |    2 ++
 5 files changed, 9 insertions(+), 1 deletion(-)
tests/generic/122.out +1 -0
index c7cfec2..7925e90 100644
@@ -4,6 +4,7 @@ Create the original files
 5e3501f97fd2669babfcbd3e1972e833  TEST_DIR/test-122/file2
 Files 1-2 do not match (intentional)
 (Fail to) dedupe the middle blocks together
+dedupe: Extents did not match.
 Compare sections
 35ac8d7917305c385c30f3d82c30a8f6  TEST_DIR/test-122/file1
 5e3501f97fd2669babfcbd3e1972e833  TEST_DIR/test-122/file2
tests/generic/136 +2 -0
index 89ee751..5d021f8 100755
@@ -82,7 +82,9 @@ test "${C2}" != "${C4}" || echo "file2 and file4 should not match"
 test "${C3}" = "${C4}" || echo "file3 and file4 should match"
 
 echo "Dedupe the last blocks together"
+echo "1->2"
 _dedupe_range "$TESTDIR/file1" $BLKSZ "$TESTDIR/file2" $BLKSZ 37 >> "$seqres.full"
+echo "1->3"
 _dedupe_range "$TESTDIR/file1" $BLKSZ "$TESTDIR/file3" $BLKSZ 37 >> "$seqres.full"
 _test_remount
 
tests/generic/136.out +3 -0
index 99a5465..f76f40a 100644
@@ -5,6 +5,9 @@ c4fd505be25a0c91bcca9f502b9a8156  TEST_DIR/test-136/file2
 07ac67bf7f271195442509e79cde4cee  TEST_DIR/test-136/file3
 07ac67bf7f271195442509e79cde4cee  TEST_DIR/test-136/file4
 Dedupe the last blocks together
+1->2
+1->3
+dedupe: Extents did not match.
 c4fd505be25a0c91bcca9f502b9a8156  TEST_DIR/test-136/file1
 c4fd505be25a0c91bcca9f502b9a8156  TEST_DIR/test-136/file2
 07ac67bf7f271195442509e79cde4cee  TEST_DIR/test-136/file3
tests/generic/137 +1 -1
index a640f4f..9cc7948 100755
@@ -83,7 +83,7 @@ done
 echo "Dedupe block two to the sevens"
 seq 1 $((NR_BLKS / 7)) | while read nr; do
 	_dedupe_range "$TESTDIR/file1" $((BLKSZ * 2)) "$TESTDIR/file1" \
-			$((nr * 7 * BLKSZ)) $BLKSZ >> "$seqres.full"
+			$((nr * 7 * BLKSZ)) $BLKSZ >> "$seqres.full" 2>&1
 done
 
 _test_remount
tests/generic/182.out +2 -0
index 9841b76..049a3ee 100644
@@ -1,10 +1,12 @@
 QA output created by 182
 Create the original files
+dedupe: Extents did not match.
 f4820540fc0ac02750739896fe028d56  TEST_DIR/test-182/file1
 69ad53078a16243d98e21d9f8704a071  TEST_DIR/test-182/file2
 69ad53078a16243d98e21d9f8704a071  TEST_DIR/test-182/file2.chk
 Compare against check files
 Make the original file almost dedup-able
+dedupe: Extents did not match.
 f4820540fc0ac02750739896fe028d56  TEST_DIR/test-182/file1
 158d4e3578b94b89cbb44493a2110fb9  TEST_DIR/test-182/file2
 158d4e3578b94b89cbb44493a2110fb9  TEST_DIR/test-182/file2.chk
#7 lore raw

PATCH 5/5 tests: use lowercase variables for all the new reflink tests

In reply to Darrick J. Wong

Since $TESTDIR is a local variable, make it lowercase to avoid confusion with $TEST_DIR. While we're at it, make all the local variables lowercase.

---
 tests/generic/110 |   24 ++++-----
 tests/generic/111 |   42 ++++++++-------
 tests/generic/115 |   34 ++++++------
 tests/generic/116 |   42 ++++++++-------
 tests/generic/118 |   42 ++++++++-------
 tests/generic/119 |  112 ++++++++++++++++++++---------------------
 tests/generic/121 |   42 ++++++++-------
 tests/generic/122 |   42 ++++++++-------
 tests/generic/134 |   90 ++++++++++++++++-----------------
 tests/generic/136 |   90 ++++++++++++++++-----------------
 tests/generic/137 |   54 ++++++++++----------
 tests/generic/138 |  100 ++++++++++++++++++------------------
 tests/generic/139 |  100 ++++++++++++++++++------------------
 tests/generic/140 |  100 ++++++++++++++++++------------------
 tests/generic/142 |   34 ++++++------
 tests/generic/143 |   34 ++++++------
 tests/generic/144 |  124 +++++++++++++++++++++++----------------------
 tests/generic/145 |  146 +++++++++++++++++++++++++++--------------------------
 tests/generic/146 |  136 +++++++++++++++++++++++++------------------------
 tests/generic/147 |  142 ++++++++++++++++++++++++++--------------------------
 tests/generic/148 |   80 +++++++++++++++--------------
 tests/generic/149 |  136 +++++++++++++++++++++++++------------------------
 tests/generic/150 |   30 +++++------
 tests/generic/151 |   46 ++++++++---------
 tests/generic/152 |   52 +++++++++----------
 tests/generic/153 |   52 +++++++++----------
 tests/generic/154 |   60 +++++++++++-----------
 tests/generic/155 |   60 +++++++++++-----------
 tests/generic/156 |   58 +++++++++++----------
 tests/generic/157 |   68 ++++++++++++-------------
 tests/generic/158 |   70 +++++++++++++------------
 tests/generic/159 |   30 +++++------
 tests/generic/160 |   30 +++++------
 tests/generic/161 |   16 +++---
 tests/generic/162 |   22 ++++----
 tests/generic/163 |   22 ++++----
 tests/generic/164 |   28 +++++-----
 tests/generic/165 |   28 +++++-----
 tests/generic/166 |   18 +++----
 tests/generic/167 |   18 +++----
 tests/generic/168 |   22 ++++----
 tests/generic/170 |   22 ++++----
 tests/generic/171 |   42 ++++++++-------
 tests/generic/172 |   42 ++++++++-------
 tests/generic/173 |   42 ++++++++-------
 tests/generic/174 |   42 ++++++++-------
 tests/generic/175 |   24 ++++-----
 tests/generic/176 |   24 ++++-----
 tests/generic/178 |   28 +++++-----
 tests/generic/179 |   46 ++++++++---------
 tests/generic/180 |   46 ++++++++---------
 tests/generic/181 |   34 ++++++------
 tests/generic/182 |   76 ++++++++++++++--------------
 tests/generic/183 |   48 +++++++++--------
 tests/generic/185 |   48 +++++++++--------
 tests/generic/186 |   54 ++++++++++----------
 tests/generic/187 |   54 ++++++++++----------
 tests/generic/188 |   40 +++++++--------
 tests/generic/189 |   40 +++++++--------
 tests/generic/190 |   40 +++++++--------
 tests/generic/191 |   40 +++++++--------
 tests/generic/194 |   46 ++++++++---------
 tests/generic/195 |   46 ++++++++---------
 tests/generic/196 |   40 +++++++--------
 tests/generic/197 |   40 +++++++--------
 tests/generic/199 |   60 +++++++++++-----------
 tests/generic/200 |   60 +++++++++++-----------
 tests/generic/201 |   34 ++++++------
 tests/generic/202 |   32 ++++++------
 tests/generic/203 |   32 ++++++------
 tests/generic/205 |   48 +++++++++--------
 tests/generic/206 |   48 +++++++++--------
 tests/generic/216 |   48 +++++++++--------
 tests/generic/217 |   48 +++++++++--------
 tests/generic/218 |   40 +++++++--------
 tests/generic/220 |   40 +++++++--------
 tests/generic/222 |   48 +++++++++--------
 tests/generic/227 |   48 +++++++++--------
 tests/generic/229 |   94 +++++++++++++++++-----------------
 tests/generic/238 |   94 +++++++++++++++++-----------------
 tests/generic/242 |   46 ++++++++---------
 tests/generic/243 |   46 ++++++++---------
 tests/xfs/127     |   16 +++---
 tests/xfs/128     |  140 +++++++++++++++++++++++++--------------------------
 tests/xfs/129     |   28 +++++-----
 tests/xfs/131     |   16 +++---
 tests/xfs/132     |   68 ++++++++++++-------------
 tests/xfs/139     |   26 +++++----
 tests/xfs/140     |   34 ++++++------
 89 files changed, 2337 insertions(+), 2337 deletions(-)
tests/generic/110 +12 -12
index fffadbc..a43f02d 100755
@@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -f $tmp.* "$TESTDIR"
+    rm -f $tmp.* "$testdir"
 }
 
 # get standard environment, filters and checks
@@ -53,37 +53,37 @@ _require_xfs_io_command "fiemap"
 _require_cp_reflink
 _require_test
 
-TESTDIR1=$TEST_DIR/test-$seq
-rm -rf $TESTDIR1
-mkdir $TESTDIR1
+testdir1=$TEST_DIR/test-$seq
+rm -rf $testdir1
+mkdir $testdir1
 
 _checksum_files() {
     for F in original copy1 copy2
     do
-        md5sum $TESTDIR1/$F | _filter_test_dir
+        md5sum $testdir1/$F | _filter_test_dir
     done
 }
 
 rm -f $seqres.full
 
 echo "Create the original file and reflink to copy1, copy2"
-$XFS_IO_PROG -f -c 'pwrite -S 0x61 0 9000' $TESTDIR1/original \
+$XFS_IO_PROG -f -c 'pwrite -S 0x61 0 9000' $testdir1/original \
     >> $seqres.full 2>&1
-cp --reflink $TESTDIR1/original $TESTDIR1/copy1
-cp --reflink $TESTDIR1/copy1 $TESTDIR1/copy2
-_verify_reflink $TESTDIR1/original $TESTDIR1/copy1
-_verify_reflink $TESTDIR1/original $TESTDIR1/copy2
+cp --reflink $testdir1/original $testdir1/copy1
+cp --reflink $testdir1/copy1 $testdir1/copy2
+_verify_reflink $testdir1/original $testdir1/copy1
+_verify_reflink $testdir1/original $testdir1/copy2
 echo "Original md5sums:"
 _checksum_files
 
 echo "Overwrite original file with new data"
-$XFS_IO_PROG -c 'pwrite -S 0x62 0 9000' $TESTDIR1/original \
+$XFS_IO_PROG -c 'pwrite -S 0x62 0 9000' $testdir1/original \
     >> $seqres.full 2>&1
 echo "md5sums after overwriting original:"
 _checksum_files
 
 echo "Overwrite copy1 with different new data"
-$XFS_IO_PROG -c 'pwrite -S 0x63 0 9000' $TESTDIR1/copy1 \
+$XFS_IO_PROG -c 'pwrite -S 0x63 0 9000' $testdir1/copy1 \
     >> $seqres.full 2>&1
 echo "md5sums after overwriting copy1:"
 _checksum_files
tests/generic/111 +21 -21

83 lines not on this page · raw message

tests/generic/115 +17 -17
index 6c8d92d..578d5bd 100755
@@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -f $tmp.* "$TESTDIR"
+    rm -f $tmp.* "$testdir"
 }
 
 # get standard environment, filters and checks
@@ -53,31 +53,31 @@ _require_test
 
 rm -f $seqres.full
 
-TESTDIR1=$TEST_DIR/test-$seq
-rm -rf $TESTDIR1
-mkdir $TESTDIR1
+testdir1=$TEST_DIR/test-$seq
+rm -rf $testdir1
+mkdir $testdir1
 
 echo "Create the original files and reflink dirs"
-$XFS_IO_PROG -f -c 'pwrite -S 0x61 0 9000' $TESTDIR1/original \
+$XFS_IO_PROG -f -c 'pwrite -S 0x61 0 9000' $testdir1/original \
     >> $seqres.full
-cp --reflink $TESTDIR1/original $TESTDIR1/copy
+cp --reflink $testdir1/original $testdir1/copy
 
-_verify_reflink $TESTDIR1/original $TESTDIR1/copy
+_verify_reflink $testdir1/original $testdir1/copy
 
 echo "Move orig & reflink copy to subdir and md5sum:"
-mkdir $TESTDIR1/subdir
-mv $TESTDIR1/original $TESTDIR1/subdir/original_moved
-mv $TESTDIR1/copy $TESTDIR1/subdir/copy_moved
-_verify_reflink $TESTDIR1/subdir/original_moved \
-    $TESTDIR1/subdir/copy_moved
+mkdir $testdir1/subdir
+mv $testdir1/original $testdir1/subdir/original_moved
+mv $testdir1/copy $testdir1/subdir/copy_moved
+_verify_reflink $testdir1/subdir/original_moved \
+    $testdir1/subdir/copy_moved
 
-md5sum $TESTDIR1/subdir/original_moved | _filter_test_dir
-md5sum $TESTDIR1/subdir/copy_moved | _filter_test_dir
+md5sum $testdir1/subdir/original_moved | _filter_test_dir
+md5sum $testdir1/subdir/copy_moved | _filter_test_dir
 
 echo "remove orig from subdir and md5sum reflink copy:"
-rm $TESTDIR1/subdir/original_moved
-md5sum $TESTDIR1/subdir/copy_moved | _filter_test_dir
-rm -rf $TESTDIR1/subdir
+rm $testdir1/subdir/original_moved
+md5sum $testdir1/subdir/copy_moved | _filter_test_dir
+rm -rf $testdir1/subdir
 
 # success, all done
 status=0
tests/generic/116 +21 -21

71 lines not on this page · raw message

tests/generic/118 +21 -21

71 lines not on this page · raw message

tests/generic/119 +56 -56

182 lines not on this page · raw message

tests/generic/121 +21 -21

71 lines not on this page · raw message

tests/generic/122 +21 -21

71 lines not on this page · raw message

tests/generic/134 +45 -45

127 lines not on this page · raw message

tests/generic/136 +45 -45

129 lines not on this page · raw message

tests/generic/137 +27 -27

107 lines not on this page · raw message

tests/generic/138 +50 -50

158 lines not on this page · raw message

tests/generic/139 +50 -50

157 lines not on this page · raw message

tests/generic/140 +50 -50

158 lines not on this page · raw message

tests/generic/142 +17 -17
index cf6d634..2ac4d10 100755
@@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -rf "$tmp".* "$TESTDIR"
+    rm -rf "$tmp".* "$testdir"
 }
 
 # get standard environment, filters and checks
@@ -52,37 +52,37 @@ _require_cp_reflink
 
 rm -f "$seqres.full"
 
-TESTDIR="$TEST_DIR/test-$seq"
-rm -rf "$TESTDIR"
-mkdir "$TESTDIR"
+testdir="$TEST_DIR/test-$seq"
+rm -rf "$testdir"
+mkdir "$testdir"
 
 echo "Create the original file blocks"
-BLKSZ=65536
-NR=9
-_pwrite_byte 0x61 0 $((BLKSZ * 256)) "$TESTDIR/file1" >> "$seqres.full"
+blksz=65536
+nr=9
+_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file1" >> "$seqres.full"
 _test_remount
 
-md5sum "$TESTDIR/file1" | _filter_test_dir
-csum="$(_md5_checksum "$TESTDIR/file1")"
+md5sum "$testdir/file1" | _filter_test_dir
+csum="$(_md5_checksum "$testdir/file1")"
 
 echo "Create the reflink copies"
-seq 2 $NR | while read i; do
-	_cp_reflink "$TESTDIR/file1" "$TESTDIR/file$i"
+seq 2 $nr | while read i; do
+	_cp_reflink "$testdir/file1" "$testdir/file$i"
 done
 _test_remount
 
 echo "Rewrite the copies"
-seq 2 $NR | while read i; do
-	_pwrite_byte 0x62 0 $((BLKSZ * 256)) "$TESTDIR/file$i" >> "$seqres.full"
+seq 2 $nr | while read i; do
+	_pwrite_byte 0x62 0 $((blksz * 256)) "$testdir/file$i" >> "$seqres.full"
 done
 _test_remount
 
 echo "Examine original file"
-md5sum "$TESTDIR/file1" | _filter_test_dir
-md5sum "$TESTDIR/file2" | _filter_test_dir
+md5sum "$testdir/file1" | _filter_test_dir
+md5sum "$testdir/file2" | _filter_test_dir
 
-mod_csum="$(_md5_checksum "$TESTDIR/file2")"
-new_csum="$(_md5_checksum "$TESTDIR/file1")"
+mod_csum="$(_md5_checksum "$testdir/file2")"
+new_csum="$(_md5_checksum "$testdir/file1")"
 test "${csum}" != "${mod_csum}" || echo "checksums do not match"
 test "${csum}" = "${new_csum}" || echo "checksums do not match"
 
tests/generic/143 +17 -17
index d2ccb94..c0bc672 100755
@@ -37,7 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -rf "$tmp".* "$TESTDIR"
+    rm -rf "$tmp".* "$testdir"
 }
 
 # get standard environment, filters and checks
@@ -52,37 +52,37 @@ _require_cp_reflink
 
 rm -f "$seqres.full"
 
-TESTDIR="$TEST_DIR/test-$seq"
-rm -rf "$TESTDIR"
-mkdir "$TESTDIR"
+testdir="$TEST_DIR/test-$seq"
+rm -rf "$testdir"
+mkdir "$testdir"
 
 echo "Create the original file blocks"
-BLKSZ=65536
-NR=9
-_pwrite_byte 0x61 0 $((BLKSZ * 256)) "$TESTDIR/file1" >> "$seqres.full"
+blksz=65536
+nr=9
+_pwrite_byte 0x61 0 $((blksz * 256)) "$testdir/file1" >> "$seqres.full"
 _test_remount
 
-md5sum "$TESTDIR/file1" | _filter_test_dir
-csum="$(_md5_checksum "$TESTDIR/file1")"
+md5sum "$testdir/file1" | _filter_test_dir
+csum="$(_md5_checksum "$testdir/file1")"
 
 echo "Create the reflink copies"
-seq 2 $NR | while read i; do
-	_cp_reflink "$TESTDIR/file1" "$TESTDIR/file$i"
+seq 2 $nr | while read i; do
+	_cp_reflink "$testdir/file1" "$testdir/file$i"
 done
 _test_remount
 
 echo "Rewrite the copies"
-seq 2 $NR | while read i; do
-	_pwrite_byte 0x62 0 $((BLKSZ * 256)) "$TESTDIR/file$i" -d >> "$seqres.full"
+seq 2 $nr | while read i; do
+	_pwrite_byte 0x62 0 $((blksz * 256)) "$testdir/file$i" -d >> "$seqres.full"
 done
 _test_remount
 
 echo "Examine original file"
-md5sum "$TESTDIR/file1" | _filter_test_dir
-md5sum "$TESTDIR/file2" | _filter_test_dir
+md5sum "$testdir/file1" | _filter_test_dir
+md5sum "$testdir/file2" | _filter_test_dir
 
-mod_csum="$(_md5_checksum "$TESTDIR/file2")"
-new_csum="$(_md5_checksum "$TESTDIR/file1")"
+mod_csum="$(_md5_checksum "$testdir/file2")"
+new_csum="$(_md5_checksum "$testdir/file1")"
 test "${csum}" != "${mod_csum}" || echo "checksums do not match"
 test "${csum}" = "${new_csum}" || echo "checksums do not match"
 
tests/generic/144 +62 -62

159 lines not on this page · raw message

tests/generic/145 +73 -73

169 lines not on this page · raw message

tests/generic/146 +68 -68

159 lines not on this page · raw message

tests/generic/147 +71 -71

165 lines not on this page · raw message

tests/generic/148 +40 -40

110 lines not on this page · raw message

tests/generic/149 +68 -68

159 lines not on this page · raw message

tests/generic/150 +15 -15
index 3046e92..f3a6311 100755
@@ -35,7 +35,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _cleanup()
 {
     cd /
-    rm -rf "$tmp".* "$TESTDIR"
+    rm -rf "$tmp".* "$testdir"
 }
 
 # get standard environment, filters and checks
@@ -50,28 +50,28 @@ _require_cp_reflink
 
 rm -f "$seqres.full"
 
-TESTDIR="$TEST_DIR/test-$seq"
-rm -rf "$TESTDIR"
-mkdir "$TESTDIR"
+testdir="$TEST_DIR/test-$seq"
+rm -rf "$testdir"
+mkdir "$testdir"
 
 echo "Create the original file blocks"
-BLKSZ="$(stat -f $TESTDIR -c '%S')"
-BLKS=2000
-MARGIN=100
-SZ=$((BLKSZ * BLKS))
-NR=7
-_pwrite_byte 0x61 0 $SZ "$TESTDIR/file1" >> "$seqres.full"
+blksz="$(stat -f $testdir -c '%S')"
+blks=2000
+margin=100
+sz=$((blksz * blks))
+nr=7
+_pwrite_byte 0x61 0 $sz "$testdir/file1" >> "$seqres.full"
 sync
-FREE_BLOCKS0=$(stat -f "$TESTDIR" -c '%f')
+free_blocks0=$(stat -f "$testdir" -c '%f')
 
 echo "Create the reflink copies"
-for i in `seq 2 $NR`; do
-	_cp_reflink "$TESTDIR/file1" "$TESTDIR/file.$i"
+for i in `seq 2 $nr`; do
+	_cp_reflink "$testdir/file1" "$testdir/file.$i"
 done
 _test_remount
-FREE_BLOCKS1=$(stat -f "$TESTDIR" -c '%f')
+free_blocks1=$(stat -f "$testdir" -c '%f')
 
-_within_tolerance "free blocks after reflink" $FREE_BLOCKS1 $FREE_BLOCKS0 $MARGIN -v
+_within_tolerance "free blocks after reflink" $free_blocks1 $free_blocks0 $margin -v
 
 # success, all done
 status=0
tests/generic/151 +23 -23

74 lines not on this page · raw message

tests/generic/152 +26 -26

81 lines not on this page · raw message

tests/generic/153 +26 -26

80 lines not on this page · raw message

tests/generic/154 +30 -30

93 lines not on this page · raw message

tests/generic/155 +30 -30

83 lines not on this page · raw message

tests/generic/156 +29 -29

58 lines not on this page · raw message

tests/generic/157 +34 -34

68 lines not on this page · raw message

tests/generic/158 +35 -35

70 lines not on this page · raw message

tests/generic/159 +15 -15
index 369663d..14baf64 100755

Lines of this file are not shown. View the raw message.

tests/generic/160 +15 -15
index 4dfee12..acd2c4e 100755

Lines of this file are not shown. View the raw message.

tests/generic/161 +8 -8
index efb137c..7fb8963 100755

Lines of this file are not shown. View the raw message.

tests/generic/162 +11 -11
index 6bd3a33..2fb947a 100755

Lines of this file are not shown. View the raw message.

tests/generic/163 +11 -11
index 1f5042f..0186443 100755

Lines of this file are not shown. View the raw message.

tests/generic/164 +14 -14
index 4df953d..087c6ba 100755

Lines of this file are not shown. View the raw message.

tests/generic/165 +14 -14
index 49187ec..6bd15e1 100755

Lines of this file are not shown. View the raw message.

tests/generic/166 +9 -9
index 93c4bc9..6cfb821 100755

Lines of this file are not shown. View the raw message.

tests/generic/167 +9 -9
index 6d70737..fc5a86c 100755

Lines of this file are not shown. View the raw message.

tests/generic/168 +11 -11
index 414dcb0..ee3848d 100755

Lines of this file are not shown. View the raw message.

tests/generic/170 +11 -11
index 704b646..6d27810 100755

Lines of this file are not shown. View the raw message.

tests/generic/171 +21 -21

42 lines not on this page · raw message

tests/generic/172 +21 -21

42 lines not on this page · raw message

tests/generic/173 +21 -21

42 lines not on this page · raw message

tests/generic/174 +21 -21

42 lines not on this page · raw message

tests/generic/175 +12 -12
index a7da533..b37ff66 100755

Lines of this file are not shown. View the raw message.

tests/generic/176 +12 -12
index bf930b7..0ca0b17 100755

Lines of this file are not shown. View the raw message.

tests/generic/178 +14 -14
index 9828dac..f1bc963 100755

Lines of this file are not shown. View the raw message.

tests/generic/179 +23 -23

46 lines not on this page · raw message

tests/generic/180 +23 -23

46 lines not on this page · raw message

tests/generic/181 +17 -17
index 03c9ccc..cb6639f 100755

Lines of this file are not shown. View the raw message.

tests/generic/182 +38 -38

76 lines not on this page · raw message

tests/generic/183 +24 -24

48 lines not on this page · raw message

tests/generic/185 +24 -24

48 lines not on this page · raw message

tests/generic/186 +27 -27

54 lines not on this page · raw message

tests/generic/187 +27 -27

54 lines not on this page · raw message

tests/generic/188 +20 -20
index 8e715ec..c67b847 100755

Lines of this file are not shown. View the raw message.

tests/generic/189 +20 -20
index a4b984f..1954235 100755

Lines of this file are not shown. View the raw message.

tests/generic/190 +20 -20
index ee53bfd..d3d573b 100755

Lines of this file are not shown. View the raw message.

tests/generic/191 +20 -20
index 6174a79..8b19084 100755

Lines of this file are not shown. View the raw message.

tests/generic/194 +23 -23

46 lines not on this page · raw message

tests/generic/195 +23 -23

46 lines not on this page · raw message

tests/generic/196 +20 -20
index 48be50c..d815232 100755

Lines of this file are not shown. View the raw message.

tests/generic/197 +20 -20
index 9bffffe..54005ae 100755

Lines of this file are not shown. View the raw message.

tests/generic/199 +30 -30

60 lines not on this page · raw message

tests/generic/200 +30 -30

60 lines not on this page · raw message

tests/generic/201 +17 -17
index fa81b5a..ffc1ce4 100755

Lines of this file are not shown. View the raw message.

tests/generic/202 +16 -16
index 2d03b55..375b65f 100755

Lines of this file are not shown. View the raw message.

tests/generic/203 +16 -16
index 8ed765e..549f2ba 100755

Lines of this file are not shown. View the raw message.

tests/generic/205 +24 -24

48 lines not on this page · raw message

tests/generic/206 +24 -24

48 lines not on this page · raw message

tests/generic/216 +24 -24

48 lines not on this page · raw message

tests/generic/217 +24 -24

48 lines not on this page · raw message

tests/generic/218 +20 -20
index 7c31092..d63c06f 100755

Lines of this file are not shown. View the raw message.

tests/generic/220 +20 -20
index 3ab9881..ccdb32e 100755

Lines of this file are not shown. View the raw message.

tests/generic/222 +24 -24

48 lines not on this page · raw message

tests/generic/227 +24 -24

48 lines not on this page · raw message

tests/generic/229 +47 -47

94 lines not on this page · raw message

tests/generic/238 +47 -47

94 lines not on this page · raw message

tests/generic/242 +23 -23

46 lines not on this page · raw message

tests/generic/243 +23 -23

46 lines not on this page · raw message

tests/xfs/127 +8 -8
index 61301de..c31cd17 100755

Lines of this file are not shown. View the raw message.

tests/xfs/128 +70 -70

140 lines not on this page · raw message

tests/xfs/129 +14 -14
index 3b7c59c..8d608f2 100755

Lines of this file are not shown. View the raw message.

tests/xfs/131 +8 -8
index 5d092f1..8442821 100755

Lines of this file are not shown. View the raw message.

tests/xfs/132 +34 -34

68 lines not on this page · raw message

tests/xfs/139 +13 -13
index 152c6bd..7400cf8 100644

Lines of this file are not shown. View the raw message.

tests/xfs/140 +17 -17
index 45be9f4..133bb72 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Part of the diff is not shown here. View the raw message.