Skip to contentSkip to conversation

generic/805: fix for external RT devices

PATCH In review Christoph Hellwig 2 participants 4 messages Sep 24 – Sep 28

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/805: fix for external RT devices

use _mkfs_dev on the dm device instead of _scratch_mkfs_sized, otherwise the file system could be created with an external RT device, and will then fail to mount without it.

---
 tests/generic/805 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/805 +2 -2
index ae498f5c6698..401829c4c6fc 100755
@@ -31,7 +31,7 @@ _cleanup()
 	rm -f $tmp.*
 }
 
-_require_scratch
+_require_scratch_nocheck
 _require_dm_target linear
 _require_freeze
 
@@ -39,13 +39,13 @@ echo "Silence is golden"
 
 size=$((256 * 1024 * 1024))
 size_in_sector=$((size / 512))
-_scratch_mkfs_sized $size >> $seqres.full 2>&1
 
 node=$seq-test
 lvdev=/dev/mapper/$node
 table="0 $size_in_sector linear $SCRATCH_DEV 0"
 _dmsetup_create $node --table "$table" || \
 	_fail "failed to create dm device"
+_mkfs_dev $lvdev >> $seqres.full 2>&1
 
 _mount $lvdev $SCRATCH_MNT || _fail "failed to mount dm device"
 
Signature · 1 line
2.53.0
#1 lore raw
Quoted 3 lines · Christoph Hellwig

use _mkfs_dev on the dm device instead of _scratch_mkfs_sized, otherwise the file system could be created with an external RT device, and will then fail to mount without it.

This patch makes sense to me. But I was wondering if we should have a helper similar to _ignore_scratch_external_devices to allow a temporary device to act as SCRATCH_DEV, so it can use the _scratch_* helpers ?

Thanks,
Zorro

Quoted 37 lines
---
 tests/generic/805 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/805 +2 -2
index ae498f5c6698..401829c4c6fc 100755
@@ -31,7 +31,7 @@ _cleanup()
 	rm -f $tmp.*
 }
 
-_require_scratch
+_require_scratch_nocheck
 _require_dm_target linear
 _require_freeze
 
@@ -39,13 +39,13 @@ echo "Silence is golden"
 
 size=$((256 * 1024 * 1024))
 size_in_sector=$((size / 512))
-_scratch_mkfs_sized $size >> $seqres.full 2>&1
 
 node=$seq-test
 lvdev=/dev/mapper/$node
 table="0 $size_in_sector linear $SCRATCH_DEV 0"
 _dmsetup_create $node --table "$table" || \
 	_fail "failed to create dm device"
+_mkfs_dev $lvdev >> $seqres.full 2>&1
 
 _mount $lvdev $SCRATCH_MNT || _fail "failed to mount dm device"
 
Signature · 1 line
2.53.0
#2 lore raw
Quoted 8 lines · Zorro Lang
Quoted 3 lines · Christoph Hellwig

use _mkfs_dev on the dm device instead of _scratch_mkfs_sized, otherwise the file system could be created with an external RT device, and will then fail to mount without it.

This patch makes sense to me. But I was wondering if we should have a helper similar to _ignore_scratch_external_devices to allow a temporary device to act as SCRATCH_DEV, so it can use the _scratch_* helpers ?

You can't just ignore external devices, as options might also not apply any more. We could add new helpers for just use scratch without external devices, but IMHO there is no much benefit over just using the _dev helpers.

Reviewed-by on v1 1/1
#3 lore raw
In reply to Christoph Hellwig
Quoted 6 lines · Christoph Hellwig

use _mkfs_dev on the dm device instead of _scratch_mkfs_sized, otherwise the file system could be created with an external RT device, and will then fail to mount without it.

---

This change is good to me,

Quoted 34 lines
 tests/generic/805 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/generic/805 +2 -2
index ae498f5c6698..401829c4c6fc 100755
@@ -31,7 +31,7 @@ _cleanup()
 	rm -f $tmp.*
 }
 
-_require_scratch
+_require_scratch_nocheck
 _require_dm_target linear
 _require_freeze
 
@@ -39,13 +39,13 @@ echo "Silence is golden"
 
 size=$((256 * 1024 * 1024))
 size_in_sector=$((size / 512))
-_scratch_mkfs_sized $size >> $seqres.full 2>&1
 
 node=$seq-test
 lvdev=/dev/mapper/$node
 table="0 $size_in_sector linear $SCRATCH_DEV 0"
 _dmsetup_create $node --table "$table" || \
 	_fail "failed to create dm device"
+_mkfs_dev $lvdev >> $seqres.full 2>&1
 
 _mount $lvdev $SCRATCH_MNT || _fail "failed to mount dm device"
 
Signature · 1 line
2.53.0