diff mbox

[v4,2/3] xfs/realtime: Default rtinherit=1, add _require_no_rtinherit function

Message ID 20180112041619.540900-3-rwareing@fb.com (mailing list archive)
State New, archived
Headers show

Commit Message

Richard Wareing Jan. 12, 2018, 4:16 a.m. UTC
To better exercise the data path code of realtime subvolumes, we will
set rtinherit=1 during mkfs calls.  For tests which this is not desired
we introduce a _require_no_rtinherit function to opt out of this
behavior.

Signed-off-by: Richard Wareing <rwareing@fb.com>
---
Changes since v3:
* XFS FS check in _require_no_rtinherit
* Fixed comment for _require_no_rtinherit to reflect (reworked) function

Changes since v2:
* Removed use of RT_INHERT, instead we now simply bail from the test.  Users
  will have to create two separate configs for realtime one with rtinherit=1
  in the mkfs options, one without and do separate runs to get full test
  coverage.
* Added comments explaining reasons for _require_no_rtinherit declarations

Changes since v1:
* None

 common/rc         | 10 ++++++++++
 tests/generic/250 |  3 +++
 tests/generic/252 |  3 +++
 tests/generic/441 |  3 +++
 tests/xfs/170     |  1 +
 5 files changed, 20 insertions(+)

Comments

Eryu Guan Jan. 19, 2018, 4:39 a.m. UTC | #1
On Thu, Jan 11, 2018 at 08:16:18PM -0800, Richard Wareing wrote:
> To better exercise the data path code of realtime subvolumes, we will
> set rtinherit=1 during mkfs calls.  For tests which this is not desired
> we introduce a _require_no_rtinherit function to opt out of this
> behavior.
> 
> Signed-off-by: Richard Wareing <rwareing@fb.com>
> ---
> Changes since v3:
> * XFS FS check in _require_no_rtinherit
> * Fixed comment for _require_no_rtinherit to reflect (reworked) function
> 
> Changes since v2:
> * Removed use of RT_INHERT, instead we now simply bail from the test.  Users
>   will have to create two separate configs for realtime one with rtinherit=1
>   in the mkfs options, one without and do separate runs to get full test
>   coverage.
> * Added comments explaining reasons for _require_no_rtinherit declarations
> 
> Changes since v1:
> * None
> 
>  common/rc         | 10 ++++++++++
>  tests/generic/250 |  3 +++
>  tests/generic/252 |  3 +++
>  tests/generic/441 |  3 +++
>  tests/xfs/170     |  1 +
>  5 files changed, 20 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index 76f9d69..cceabce 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -33,6 +33,16 @@ BC=$(which bc 2> /dev/null) || BC=
>  VALID_TEST_ID="[0-9]\{3\}"
>  VALID_TEST_NAME="$VALID_TEST_ID-\?[[:alnum:]-]*"
>  
> +# Some tests are not relevant or functional when testing XFS realtime
> +# subvolumes along with the rtinherit=1 mkfs option.  In these cases,
> +# this test will opt-out of the test.
> +_require_no_rtinherit()
> +{
> +  [ "$FSTYP" = "xfs" ] && echo "$MKFS_OPTIONS" | 

Trailing whitespace in above line :)

> +    egrep -q "rtinherit([^=]|=1)" && \

Hmm, this works with "-drtinherit=1" and "-drtinherit,<other opts>" but
fails to detect the "-d rtinherit" case, because the regexp expects some
character after "rtinherit". I think this change could fix it:

-   egrep -q "rtinherit([^=]|=1)" && \
+   egrep -q "rtinherit([^=]|=1|$)" && \

If this looks ok to you, I can fix it on commit (along with the
whitespace issue).

Thanks,
Eryu

> +    _notrun "rtinherit mkfs option is not supported by this test."
> +}
> +
>  _require_math()
>  {
>  	if [ -z "$BC" ]; then
> diff --git a/tests/generic/250 b/tests/generic/250
> index 3c4fe6d..a8fd97e 100755
> --- a/tests/generic/250
> +++ b/tests/generic/250
> @@ -48,6 +48,9 @@ _require_scratch
>  _require_dm_target error
>  _require_xfs_io_command "falloc"
>  _require_odirect
> +# This test uses "dm" without taking into account the data could be on
> +# realtime subvolume, thus the test will fail with rtinherit=1
> +_require_no_rtinherit
>  
>  rm -f $seqres.full
>  
> diff --git a/tests/generic/252 b/tests/generic/252
> index ffedd56..b506d59 100755
> --- a/tests/generic/252
> +++ b/tests/generic/252
> @@ -47,6 +47,9 @@ _supported_os Linux
>  _require_scratch
>  _require_dm_target error
>  _require_xfs_io_command "falloc"
> +# This test uses "dm" without taking into account the data could be on
> +# realtime subvolume, thus the test will fail with rtinherit=1
> +_require_no_rtinherit
>  _require_aiodio "aiocp"
>  AIO_TEST="src/aio-dio-regress/aiocp"
>  
> diff --git a/tests/generic/441 b/tests/generic/441
> index 075d877..5fbfece 100755
> --- a/tests/generic/441
> +++ b/tests/generic/441
> @@ -47,6 +47,9 @@ _cleanup()
>  # real QA test starts here
>  _supported_os Linux
>  _require_scratch
> +# This test uses "dm" without taking into account the data could be on
> +# realtime subvolume, thus the test will fail with rtinherit=1
> +_require_no_rtinherit
>  
>  # Generally, we want to avoid journal errors on the extended testcase. Only
>  # unset the -s flag if we have a logdev
> diff --git a/tests/xfs/170 b/tests/xfs/170
> index c5ae8e4..6deef1b 100755
> --- a/tests/xfs/170
> +++ b/tests/xfs/170
> @@ -50,6 +50,7 @@ _supported_fs xfs
>  _supported_os Linux
>  
>  _require_scratch
> +_require_no_rtinherit
>  
>  _check_filestreams_support || _notrun "filestreams not available"
>  
> -- 
> 2.9.5
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eryu Guan Jan. 19, 2018, 8:07 a.m. UTC | #2
On Thu, Jan 11, 2018 at 08:16:18PM -0800, Richard Wareing wrote:
> To better exercise the data path code of realtime subvolumes, we will
> set rtinherit=1 during mkfs calls.  For tests which this is not desired
> we introduce a _require_no_rtinherit function to opt out of this
> behavior.
> 
> Signed-off-by: Richard Wareing <rwareing@fb.com>

BTW, generic/256 triggered xfs shutdown with rtdev enabled and
MKFS_OPTIONS="-d rtinherit".

Thanks,
Eryu

[59132.903870] XFS (vda6): _xfs_buf_find: Block out of range: block 0xc00000003fff0, EOFS 0x300000
[59132.904675] WARNING: CPU: 3 PID: 1199 at fs/xfs/xfs_buf.c:590 _xfs_buf_find+0x3e8/0x520 [xfs]
[59132.905352] Modules linked in: xfs dm_delay dm_thin_pool dm_persistent_data dm_bio_prison sd_mod sg dm_snapshot dm_bufio dm_flakey loop dm_mod ip6t_rpfilter ipt_REJECT nf_reject_ipv4 ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack libcrc32c iptable_mangle iptable_security iptable_raw ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter sunrpc btrfs xor zstd_decompress zstd_compress xxhash raid6_pq i2c_piix4 i2c_core virtio_balloon joydev pcspkr ip_tables ext4 mbcache jbd2 ata_generic pata_acpi virtio_net virtio_blk ata_piix libata virtio_pci virtio_ring virtio
[59132.905607]  serio_raw floppy [last unloaded: scsi_debug]
[59132.905607] CPU: 3 PID: 1199 Comm: xfs_io Tainted: G        W        4.15.0-rc6 #28
[59132.905607] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2007
[59132.905607] RIP: 0010:_xfs_buf_find+0x3e8/0x520 [xfs]
[59132.905607] RSP: 0018:ffff9eb8c1d83718 EFLAGS: 00010246
[59132.905607] RAX: 0000000000000000 RBX: ffff9eb8c1d83878 RCX: 0000000000000000
[59132.905607] RDX: ffff9eb8c1d83638 RSI: 000000000000000a RDI: ffffffffc0758ebb
[59132.905607] RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000021
[59132.905607] R10: 0000000000000000 R11: 000000000000000a R12: ffff93846fb19b40
[59132.905607] R13: ffff93846fb19b40 R14: 0000000000000001 R15: ffff9eb8c1d83878
[59132.905607] FS:  00007f8cb01ea740(0000) GS:ffff93849fd80000(0000) knlGS:0000000000000000
[59132.905607] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[59132.905607] CR2: 00007f8caf9eefb8 CR3: 0000000215749000 CR4: 00000000000006e0
[59132.905607] Call Trace:
[59132.905607]  ? _cond_resched+0x15/0x30
[59132.905607]  xfs_buf_get_map+0x23/0x260 [xfs]
[59132.905607]  xfs_buf_read_map+0x29/0x180 [xfs]
[59132.905607]  xfs_trans_read_buf_map+0xec/0x300 [xfs]
[59132.905607]  xfs_rtbuf_get+0xf5/0x130 [xfs]
[59132.905607]  xfs_rtcheck_range+0x10a/0x300 [xfs]
[59132.905607]  xfs_rtallocate_extent_block+0x137/0x240 [xfs]
[59132.905607]  xfs_rtallocate_extent_near+0x287/0x390 [xfs]
[59132.905607]  ? up+0x12/0x46
[59132.905607]  ? xfs_buf_rele+0x5b/0x390 [xfs]
[59132.905607]  xfs_rtallocate_extent+0x121/0x1b0 [xfs]
[59132.905607]  xfs_bmap_rtalloc+0x180/0x2b0 [xfs]
[59132.905607]  xfs_bmapi_write+0x5dc/0xce0 [xfs]
[59132.905607]  ? lookup_fast+0xcb/0x2b0
[59132.905607]  xfs_alloc_file_space+0x15a/0x3a0 [xfs]
[59132.905607]  ? account_entity_enqueue+0xc5/0xf0
[59132.905607]  xfs_file_fallocate+0x1e2/0x330 [xfs]
[59132.905607]  ? check_preempt_curr+0x74/0xa0
[59132.905607]  ? wake_up_new_task+0x1c4/0x280
[59132.905607]  vfs_fallocate+0x151/0x270
[59132.905607]  SyS_fallocate+0x3f/0x60
[59132.905607]  do_syscall_64+0x61/0x1a0
[59132.905607]  entry_SYSCALL64_slow_path+0x25/0x25
[59132.905607] RIP: 0033:0x7f8cafae47e0
[59132.905607] RSP: 002b:00007ffd3ad5eb50 EFLAGS: 00000293 ORIG_RAX: 000000000000011d
[59132.905607] RAX: ffffffffffffffda RBX: 000000000000011d RCX: 00007f8cafae47e0
[59132.905607] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
[59132.905607] RBP: 0000000001111130 R08: 0000000000000000 R09: 00000000011123e2
[59132.905607] R10: 0000000010000000 R11: 0000000000000293 R12: 0000000000000000
[59132.905607] R13: 00000000011127c0 R14: 0000000000000001 R15: 0000000000000000
[59132.905607] Code: 48 89 de ff d0 49 8b 45 00 48 85 c0 75 e5 e9 57 ff ff ff 48 89 c1 48 c7 c2 c0 56 75 c0 48 c7 c6 80 c7 75 c0 31 c0 e8 68 89 01 00 <0f> ff 31 c0 e9 74 ff ff ff 39 ca 0f 82 56 fe ff ff 48 8b 4c 24
[59132.905607] ---[ end trace 2525be156b26eb0c ]---
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/common/rc b/common/rc
index 76f9d69..cceabce 100644
--- a/common/rc
+++ b/common/rc
@@ -33,6 +33,16 @@  BC=$(which bc 2> /dev/null) || BC=
 VALID_TEST_ID="[0-9]\{3\}"
 VALID_TEST_NAME="$VALID_TEST_ID-\?[[:alnum:]-]*"
 
+# Some tests are not relevant or functional when testing XFS realtime
+# subvolumes along with the rtinherit=1 mkfs option.  In these cases,
+# this test will opt-out of the test.
+_require_no_rtinherit()
+{
+  [ "$FSTYP" = "xfs" ] && echo "$MKFS_OPTIONS" | 
+    egrep -q "rtinherit([^=]|=1)" && \
+    _notrun "rtinherit mkfs option is not supported by this test."
+}
+
 _require_math()
 {
 	if [ -z "$BC" ]; then
diff --git a/tests/generic/250 b/tests/generic/250
index 3c4fe6d..a8fd97e 100755
--- a/tests/generic/250
+++ b/tests/generic/250
@@ -48,6 +48,9 @@  _require_scratch
 _require_dm_target error
 _require_xfs_io_command "falloc"
 _require_odirect
+# This test uses "dm" without taking into account the data could be on
+# realtime subvolume, thus the test will fail with rtinherit=1
+_require_no_rtinherit
 
 rm -f $seqres.full
 
diff --git a/tests/generic/252 b/tests/generic/252
index ffedd56..b506d59 100755
--- a/tests/generic/252
+++ b/tests/generic/252
@@ -47,6 +47,9 @@  _supported_os Linux
 _require_scratch
 _require_dm_target error
 _require_xfs_io_command "falloc"
+# This test uses "dm" without taking into account the data could be on
+# realtime subvolume, thus the test will fail with rtinherit=1
+_require_no_rtinherit
 _require_aiodio "aiocp"
 AIO_TEST="src/aio-dio-regress/aiocp"
 
diff --git a/tests/generic/441 b/tests/generic/441
index 075d877..5fbfece 100755
--- a/tests/generic/441
+++ b/tests/generic/441
@@ -47,6 +47,9 @@  _cleanup()
 # real QA test starts here
 _supported_os Linux
 _require_scratch
+# This test uses "dm" without taking into account the data could be on
+# realtime subvolume, thus the test will fail with rtinherit=1
+_require_no_rtinherit
 
 # Generally, we want to avoid journal errors on the extended testcase. Only
 # unset the -s flag if we have a logdev
diff --git a/tests/xfs/170 b/tests/xfs/170
index c5ae8e4..6deef1b 100755
--- a/tests/xfs/170
+++ b/tests/xfs/170
@@ -50,6 +50,7 @@  _supported_fs xfs
 _supported_os Linux
 
 _require_scratch
+_require_no_rtinherit
 
 _check_filestreams_support || _notrun "filestreams not available"