mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
common/dmerror: add some more dmerror routines
Add functions to the dmerror routine so that we can load both the error table and the linear table. This will help us with EIO testing of copy-on-write. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
+25
-2
@@ -46,15 +46,23 @@ _dmerror_mount()
|
||||
_mount -t $FSTYP `_dmerror_mount_options $*`
|
||||
}
|
||||
|
||||
_dmerror_unmount()
|
||||
{
|
||||
umount $SCRATCH_MNT
|
||||
}
|
||||
|
||||
_dmerror_cleanup()
|
||||
{
|
||||
$UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
|
||||
$DMSETUP_PROG remove error-test > /dev/null 2>&1
|
||||
}
|
||||
|
||||
_dmerror_load_table()
|
||||
_dmerror_load_error_table()
|
||||
{
|
||||
$DMSETUP_PROG suspend error-test
|
||||
suspend_opt="--nolockfs"
|
||||
[ $# -gt 1 ] && [ $2 -eq 1 ] && suspend_opt=""
|
||||
|
||||
$DMSETUP_PROG suspend $suspend_opt error-test
|
||||
[ $? -ne 0 ] && _fail "dmsetup suspend failed"
|
||||
|
||||
$DMSETUP_PROG load error-test --table "$DMERROR_TABLE"
|
||||
@@ -63,3 +71,18 @@ _dmerror_load_table()
|
||||
$DMSETUP_PROG resume error-test
|
||||
[ $? -ne 0 ] && _fail "dmsetup resume failed"
|
||||
}
|
||||
|
||||
_dmerror_load_working_table()
|
||||
{
|
||||
suspend_opt="--nolockfs"
|
||||
[ $# -gt 1 ] && [ $2 -eq 1 ] && suspend_opt=""
|
||||
|
||||
$DMSETUP_PROG suspend $suspend_opt error-test
|
||||
[ $? -ne 0 ] && _fail "dmsetup suspend failed"
|
||||
|
||||
$DMSETUP_PROG load error-test --table "$DMLINEAR_TABLE"
|
||||
[ $? -ne 0 ] && _fail "dmsetup failed to load error table"
|
||||
|
||||
$DMSETUP_PROG resume error-test
|
||||
[ $? -ne 0 ] && _fail "dmsetup resume failed"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user