diff mbox

[v5,2/3] generic/413: skip dax to nondax dio test if needed

Message ID 1506328847-1669-3-git-send-email-xzhou@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Murphy Zhou Sept. 25, 2017, 8:40 a.m. UTC
Since not all devices support dax has struct page backend,
which will not support this test.

Signed-off-by: Xiong Zhou <xzhou@redhat.com>
---
 tests/generic/413 | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Eryu Guan Sept. 27, 2017, 9:50 a.m. UTC | #1
On Mon, Sep 25, 2017 at 04:40:46PM +0800, Xiong Zhou wrote:
> Since not all devices support dax has struct page backend,
> which will not support this test.
> 
> Signed-off-by: Xiong Zhou <xzhou@redhat.com>
> ---
>  tests/generic/413 | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tests/generic/413 b/tests/generic/413
> index a1cc514..b86c10f 100755
> --- a/tests/generic/413
> +++ b/tests/generic/413
> @@ -88,6 +88,14 @@ t_nondax_to_dax()
>  t_dax_to_nondax()
>  {
>  	prep_files
> +	# dax to nondax dio needs struct page backend, which is
> +	# not always avaiable among various devices. Skip this
> +	# subtest if not compatible.
> +	if ! src/t_mmap_dio $SCRATCH_MNT/tf_s \
> +	   $TEST_DIR/tf_d $1 "test" > /dev/null 2>&1 ; then
> +		return
> +	fi
> +

Then we will never get a failure from this case, even if it's a real
bug.. We need better way to tell if there's struct page present :)

Thanks,
Eryu

>  	src/t_mmap_dio $SCRATCH_MNT/tf_s \
>  		$TEST_DIR/tf_d $1 "dio dax to nondax"
>  
> -- 
> 1.8.3.1
> 
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jeff Moyer Sept. 27, 2017, 3:01 p.m. UTC | #2
Eryu Guan <eguan@redhat.com> writes:

> On Mon, Sep 25, 2017 at 04:40:46PM +0800, Xiong Zhou wrote:
>> Since not all devices support dax has struct page backend,
>> which will not support this test.
>> 
>> Signed-off-by: Xiong Zhou <xzhou@redhat.com>
>> ---
>>  tests/generic/413 | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>> 
>> diff --git a/tests/generic/413 b/tests/generic/413
>> index a1cc514..b86c10f 100755
>> --- a/tests/generic/413
>> +++ b/tests/generic/413
>> @@ -88,6 +88,14 @@ t_nondax_to_dax()
>>  t_dax_to_nondax()
>>  {
>>  	prep_files
>> +	# dax to nondax dio needs struct page backend, which is
>> +	# not always avaiable among various devices. Skip this
>> +	# subtest if not compatible.
>> +	if ! src/t_mmap_dio $SCRATCH_MNT/tf_s \
>> +	   $TEST_DIR/tf_d $1 "test" > /dev/null 2>&1 ; then
>> +		return
>> +	fi
>> +
>
> Then we will never get a failure from this case, even if it's a real
> bug.. We need better way to tell if there's struct page present :)

ndctl list will tell you the mode of the namespace.  If it's 'raw', then
it doesn't have struct page backing.  If it's 'memory', it should work
fine.

-Jeff
--
To unsubscribe from this list: send the line "unsubscribe fstests" 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/tests/generic/413 b/tests/generic/413
index a1cc514..b86c10f 100755
--- a/tests/generic/413
+++ b/tests/generic/413
@@ -88,6 +88,14 @@  t_nondax_to_dax()
 t_dax_to_nondax()
 {
 	prep_files
+	# dax to nondax dio needs struct page backend, which is
+	# not always avaiable among various devices. Skip this
+	# subtest if not compatible.
+	if ! src/t_mmap_dio $SCRATCH_MNT/tf_s \
+	   $TEST_DIR/tf_d $1 "test" > /dev/null 2>&1 ; then
+		return
+	fi
+
 	src/t_mmap_dio $SCRATCH_MNT/tf_s \
 		$TEST_DIR/tf_d $1 "dio dax to nondax"