diff mbox

generic/473: test return EBUSY from BLKRRPART for mounted whole-dev

Message ID 1511956946-16667-1-git-send-email-yangx.jy@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Xiao Yang Nov. 29, 2017, 12:02 p.m. UTC
If the entire block device is formatted with a filesystem and
mounted, running "blockdev --rereadpt" should fail and return
EBUSY instead of pass.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 tests/generic/473     | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/generic/473.out |  2 ++
 tests/generic/group   |  1 +
 3 files changed, 86 insertions(+)
 create mode 100755 tests/generic/473
 create mode 100644 tests/generic/473.out

Comments

Eryu Guan Dec. 4, 2017, 8:29 a.m. UTC | #1
On Wed, Nov 29, 2017 at 08:02:26PM +0800, Xiao Yang wrote:
> If the entire block device is formatted with a filesystem and
> mounted, running "blockdev --rereadpt" should fail and return
> EBUSY instead of pass.
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>

As we have blktests[1] now, I think this may fit in blktests better?

Thanks,
Eryu

[1] https://github.com/osandov/blktests

> ---
>  tests/generic/473     | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/generic/473.out |  2 ++
>  tests/generic/group   |  1 +
>  3 files changed, 86 insertions(+)
>  create mode 100755 tests/generic/473
>  create mode 100644 tests/generic/473.out
> 
> diff --git a/tests/generic/473 b/tests/generic/473
> new file mode 100755
> index 0000000..d7998cd
> --- /dev/null
> +++ b/tests/generic/473
> @@ -0,0 +1,83 @@
> +#! /bin/bash
> +# FS QA Test No. 473
> +#
> +# Regression test for commit:
> +# 77032ca ("Return EBUSY from BLKRRPART for mounted whole-dev fs")
> +#
> +# If the entire block device is formatted with a filesystem and
> +# mounted, running "blockdev --rereadpt" should fail and return
> +# EBUSY.  On buggy kernel, it passes unexpectedly.
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
> +# Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it would be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write the Free Software Foundation,
> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
> +#-----------------------------------------------------------------------
> +#
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmpdir=`mktemp -d`
> +status=1	# failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 7 15
> +
> +_cleanup()
> +{
> +	# Umount
> +	$UMOUNT_PROG $tmpdir >>$seqres.full 2>&1
> +	# Destroy device
> +        _put_scsi_debug_dev
> +	rm -rf $tmpdir
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/scsi_debug
> +
> +# remove previous $seqres.full before test
> +rm -f $seqres.full
> +
> +# real QA test starts here
> +_supported_os Linux
> +_require_scsi_debug
> +
> +# Create and format
> +test_dev=`_get_scsi_debug_dev`
> +_mkfs_dev $test_dev >>$seqres.full 2>&1
> +
> +# Mount and check mounted whole-dev
> +_mount $test_dev $tmpdir
> +
> +out=$(blockdev --rereadpt $test_dev 2>&1)
> +res=$?
> +
> +echo $out | grep -q "Unknown command" && \
> +	_notrun "blockdev --rereadpt was not supported"
> +
> +[ $res -eq 0 ] && _fail "blockdev --rereadpt passed when checking mounted whole-dev"
> +
> +echo $out | grep -q "Device or resource busy" || \
> +	_fail "blockdev --rereadpt returned unexpected error when checking mounted whole-dev"
> +
> +echo $out >> $seqres.full
> +
> +echo "Silence is golden"
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/tests/generic/473.out b/tests/generic/473.out
> new file mode 100644
> index 0000000..854fbcd
> --- /dev/null
> +++ b/tests/generic/473.out
> @@ -0,0 +1,2 @@
> +QA output created by 473
> +Silence is golden
> diff --git a/tests/generic/group b/tests/generic/group
> index 6c3bb03..54b9404 100644
> --- a/tests/generic/group
> +++ b/tests/generic/group
> @@ -472,3 +472,4 @@
>  467 auto quick exportfs
>  468 shutdown auto quick metadata
>  469 auto quick
> +473 auto quick blockdev
> -- 
> 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
--
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
Xiao Yang Dec. 4, 2017, 9:15 a.m. UTC | #2
On 2017/12/04 16:29, Eryu Guan wrote:
> On Wed, Nov 29, 2017 at 08:02:26PM +0800, Xiao Yang wrote:
>> If the entire block device is formatted with a filesystem and
>> mounted, running "blockdev --rereadpt" should fail and return
>> EBUSY instead of pass.
>>
>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
> As we have blktests[1] now, I think this may fit in blktests better?
Hi Eryu,

Do you think test cases which use scsi_debug module should be moved into 
blktests?
(e.g. generic/108, generic/349, generic/350, generic/351)

Thanks,
Xiao Yang
> Thanks,
> Eryu
>
> [1] https://github.com/osandov/blktests
>
>> ---
>>   tests/generic/473     | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++
>>   tests/generic/473.out |  2 ++
>>   tests/generic/group   |  1 +
>>   3 files changed, 86 insertions(+)
>>   create mode 100755 tests/generic/473
>>   create mode 100644 tests/generic/473.out
>>
>> diff --git a/tests/generic/473 b/tests/generic/473
>> new file mode 100755
>> index 0000000..d7998cd
>> --- /dev/null
>> +++ b/tests/generic/473
>> @@ -0,0 +1,83 @@
>> +#! /bin/bash
>> +# FS QA Test No. 473
>> +#
>> +# Regression test for commit:
>> +# 77032ca ("Return EBUSY from BLKRRPART for mounted whole-dev fs")
>> +#
>> +# If the entire block device is formatted with a filesystem and
>> +# mounted, running "blockdev --rereadpt" should fail and return
>> +# EBUSY.  On buggy kernel, it passes unexpectedly.
>> +#
>> +#-----------------------------------------------------------------------
>> +# Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
>> +# Author: Xiao Yang<yangx.jy@cn.fujitsu.com>
>> +#
>> +# This program is free software; you can redistribute it and/or
>> +# modify it under the terms of the GNU General Public License as
>> +# published by the Free Software Foundation.
>> +#
>> +# This program is distributed in the hope that it would be useful,
>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> +# GNU General Public License for more details.
>> +#
>> +# You should have received a copy of the GNU General Public License
>> +# along with this program; if not, write the Free Software Foundation,
>> +# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>> +#-----------------------------------------------------------------------
>> +#
>> +
>> +seq=`basename $0`
>> +seqres=$RESULT_DIR/$seq
>> +echo "QA output created by $seq"
>> +
>> +here=`pwd`
>> +tmpdir=`mktemp -d`
>> +status=1	# failure is the default!
>> +trap "_cleanup; exit \$status" 0 1 2 3 7 15
>> +
>> +_cleanup()
>> +{
>> +	# Umount
>> +	$UMOUNT_PROG $tmpdir>>$seqres.full 2>&1
>> +	# Destroy device
>> +        _put_scsi_debug_dev
>> +	rm -rf $tmpdir
>> +}
>> +
>> +# get standard environment, filters and checks
>> +. ./common/rc
>> +. ./common/scsi_debug
>> +
>> +# remove previous $seqres.full before test
>> +rm -f $seqres.full
>> +
>> +# real QA test starts here
>> +_supported_os Linux
>> +_require_scsi_debug
>> +
>> +# Create and format
>> +test_dev=`_get_scsi_debug_dev`
>> +_mkfs_dev $test_dev>>$seqres.full 2>&1
>> +
>> +# Mount and check mounted whole-dev
>> +_mount $test_dev $tmpdir
>> +
>> +out=$(blockdev --rereadpt $test_dev 2>&1)
>> +res=$?
>> +
>> +echo $out | grep -q "Unknown command"&&  \
>> +	_notrun "blockdev --rereadpt was not supported"
>> +
>> +[ $res -eq 0 ]&&  _fail "blockdev --rereadpt passed when checking mounted whole-dev"
>> +
>> +echo $out | grep -q "Device or resource busy" || \
>> +	_fail "blockdev --rereadpt returned unexpected error when checking mounted whole-dev"
>> +
>> +echo $out>>  $seqres.full
>> +
>> +echo "Silence is golden"
>> +
>> +# success, all done
>> +status=0
>> +exit
>> diff --git a/tests/generic/473.out b/tests/generic/473.out
>> new file mode 100644
>> index 0000000..854fbcd
>> --- /dev/null
>> +++ b/tests/generic/473.out
>> @@ -0,0 +1,2 @@
>> +QA output created by 473
>> +Silence is golden
>> diff --git a/tests/generic/group b/tests/generic/group
>> index 6c3bb03..54b9404 100644
>> --- a/tests/generic/group
>> +++ b/tests/generic/group
>> @@ -472,3 +472,4 @@
>>   467 auto quick exportfs
>>   468 shutdown auto quick metadata
>>   469 auto quick
>> +473 auto quick blockdev
>> -- 
>> 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
> --
> 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
>
>
> .
>



--
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
Eryu Guan Dec. 4, 2017, 9:25 a.m. UTC | #3
On Mon, Dec 04, 2017 at 05:15:17PM +0800, Xiao Yang wrote:
> On 2017/12/04 16:29, Eryu Guan wrote:
> > On Wed, Nov 29, 2017 at 08:02:26PM +0800, Xiao Yang wrote:
> > > If the entire block device is formatted with a filesystem and
> > > mounted, running "blockdev --rereadpt" should fail and return
> > > EBUSY instead of pass.
> > > 
> > > Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
> > As we have blktests[1] now, I think this may fit in blktests better?
> Hi Eryu,
> 
> Do you think test cases which use scsi_debug module should be moved into
> blktests?
> (e.g. generic/108, generic/349, generic/350, generic/351)

I don't think they need to be moved to blktests. Most other tests that
take use of scsi_debug are for filesystem testing, e.g. generic/108.
generic/349 generic/35[01] are a bit special, they were there before
blktests was announced available, so they're in a special blockdev group
and not in the auto group. If Omar agrees, I think they can be ported to
blktests.

Thanks,
Eryu
--
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
Xiao Yang Dec. 4, 2017, 9:48 a.m. UTC | #4
On 2017/12/04 17:25, Eryu Guan wrote:
> On Mon, Dec 04, 2017 at 05:15:17PM +0800, Xiao Yang wrote:
>> On 2017/12/04 16:29, Eryu Guan wrote:
>>> On Wed, Nov 29, 2017 at 08:02:26PM +0800, Xiao Yang wrote:
>>>> If the entire block device is formatted with a filesystem and
>>>> mounted, running "blockdev --rereadpt" should fail and return
>>>> EBUSY instead of pass.
>>>>
>>>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
>>> As we have blktests[1] now, I think this may fit in blktests better?
>> Hi Eryu,
>>
>> Do you think test cases which use scsi_debug module should be moved into
>> blktests?
>> (e.g. generic/108, generic/349, generic/350, generic/351)
> I don't think they need to be moved to blktests. Most other tests that
> take use of scsi_debug are for filesystem testing, e.g. generic/108.
> generic/349 generic/35[01] are a bit special, they were there before
> blktests was announced available, so they're in a special blockdev group
> and not in the auto group. If Omar agrees, I think they can be ported to
> blktests.
Hi Eryu,

Thanks for your explanation, and i will try to send it to blktests.

Thanks,
Xiao Yang
> Thanks,
> Eryu
>
>
>



--
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
Omar Sandoval Dec. 4, 2017, 6:29 p.m. UTC | #5
On Mon, Dec 04, 2017 at 05:48:36PM +0800, Xiao Yang wrote:
> On 2017/12/04 17:25, Eryu Guan wrote:
> > On Mon, Dec 04, 2017 at 05:15:17PM +0800, Xiao Yang wrote:
> > > On 2017/12/04 16:29, Eryu Guan wrote:
> > > > On Wed, Nov 29, 2017 at 08:02:26PM +0800, Xiao Yang wrote:
> > > > > If the entire block device is formatted with a filesystem and
> > > > > mounted, running "blockdev --rereadpt" should fail and return
> > > > > EBUSY instead of pass.
> > > > > 
> > > > > Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
> > > > As we have blktests[1] now, I think this may fit in blktests better?
> > > Hi Eryu,
> > > 
> > > Do you think test cases which use scsi_debug module should be moved into
> > > blktests?
> > > (e.g. generic/108, generic/349, generic/350, generic/351)
> > I don't think they need to be moved to blktests. Most other tests that
> > take use of scsi_debug are for filesystem testing, e.g. generic/108.
> > generic/349 generic/35[01] are a bit special, they were there before
> > blktests was announced available, so they're in a special blockdev group
> > and not in the auto group. If Omar agrees, I think they can be ported to
> > blktests.
> Hi Eryu,
> 
> Thanks for your explanation, and i will try to send it to blktests.
> 
> Thanks,
> Xiao Yang

I agree, the three tests Eryu mentioned and this new test would be a
good fit for blktests. Let me know if you need any help porting, things
are a little different from xfstests.
--
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
Xiao Yang Dec. 19, 2017, 10:45 a.m. UTC | #6
On 2017/12/05 2:29, Omar Sandoval wrote:
> On Mon, Dec 04, 2017 at 05:48:36PM +0800, Xiao Yang wrote:
>> On 2017/12/04 17:25, Eryu Guan wrote:
>>> On Mon, Dec 04, 2017 at 05:15:17PM +0800, Xiao Yang wrote:
>>>> On 2017/12/04 16:29, Eryu Guan wrote:
>>>>> On Wed, Nov 29, 2017 at 08:02:26PM +0800, Xiao Yang wrote:
>>>>>> If the entire block device is formatted with a filesystem and
>>>>>> mounted, running "blockdev --rereadpt" should fail and return
>>>>>> EBUSY instead of pass.
>>>>>>
>>>>>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
>>>>> As we have blktests[1] now, I think this may fit in blktests better?
>>>> Hi Eryu,
>>>>
>>>> Do you think test cases which use scsi_debug module should be moved into
>>>> blktests?
>>>> (e.g. generic/108, generic/349, generic/350, generic/351)
>>> I don't think they need to be moved to blktests. Most other tests that
>>> take use of scsi_debug are for filesystem testing, e.g. generic/108.
>>> generic/349 generic/35[01] are a bit special, they were there before
>>> blktests was announced available, so they're in a special blockdev group
>>> and not in the auto group. If Omar agrees, I think they can be ported to
>>> blktests.
>> Hi Eryu,
>>
>> Thanks for your explanation, and i will try to send it to blktests.
>>
>> Thanks,
>> Xiao Yang
> I agree, the three tests Eryu mentioned and this new test would be a
> good fit for blktests. Let me know if you need any help porting, things
> are a little different from xfstests.
Hi Omar,

With gcc v4.4.7 on RHEL6, i got the following compiler error:
----------------------------------------------------------------------------------------------------------------------
[root@RHEL6U9GA_Intel64 blktests]# make
make -C src all
make[1]: Entering directory `/root/blktests/src'
cc -Wall -o sg/syzkaller1 -O2 sg/syzkaller1.c
sg/syzkaller1.c: In function ‘segv_handler’:
sg/syzkaller1.c:118: warning: implicit declaration of function 
‘__atomic_load_n’
sg/syzkaller1.c:118: error: ‘__ATOMIC_RELAXED’ undeclared (first use in 
this function)
sg/syzkaller1.c:118: error: (Each undeclared identifier is reported only 
once
sg/syzkaller1.c:118: error: for each function it appears in.)
sg/syzkaller1.c: In function ‘syz_open_dev’:
sg/syzkaller1.c:204: warning: implicit declaration of function 
‘__atomic_fetch_add’
sg/syzkaller1.c:204: error: ‘__ATOMIC_SEQ_CST’ undeclared (first use in 
this function)
sg/syzkaller1.c:204: warning: implicit declaration of function 
‘__atomic_fetch_sub’
sg/syzkaller1.c: In function ‘test’:
sg/syzkaller1.c:406: error: ‘__ATOMIC_SEQ_CST’ undeclared (first use in 
this function)
make[1]: *** [sg/syzkaller1] Error 1
make[1]: Leaving directory `/root/blktests/src'
make: *** [all] Error 2
-----------------------------------------------------------------------------------------------------------------------

It seems that __atomic_* functions are not available, and could you tell 
me how to fix
the compiler error?

Thanks,
Xiao Yang
>
>



--
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
Johannes Thumshirn Dec. 19, 2017, 10:53 a.m. UTC | #7
Xiao Yang <yangx.jy@cn.fujitsu.com> writes:
> [root@RHEL6U9GA_Intel64 blktests]# make
> make -C src all
> make[1]: Entering directory `/root/blktests/src'
> cc -Wall -o sg/syzkaller1 -O2 sg/syzkaller1.c
> sg/syzkaller1.c: In function ‘segv_handler’:
> sg/syzkaller1.c:118: warning: implicit declaration of function
> ‘__atomic_load_n’
> sg/syzkaller1.c:118: error: ‘__ATOMIC_RELAXED’ undeclared (first use
> in this function)
> sg/syzkaller1.c:118: error: (Each undeclared identifier is reported
> only once
> sg/syzkaller1.c:118: error: for each function it appears in.)
> sg/syzkaller1.c: In function ‘syz_open_dev’:
> sg/syzkaller1.c:204: warning: implicit declaration of function
> ‘__atomic_fetch_add’
> sg/syzkaller1.c:204: error: ‘__ATOMIC_SEQ_CST’ undeclared (first use
> in this function)
> sg/syzkaller1.c:204: warning: implicit declaration of function
> ‘__atomic_fetch_sub’
> sg/syzkaller1.c: In function ‘test’:
> sg/syzkaller1.c:406: error: ‘__ATOMIC_SEQ_CST’ undeclared (first use
> in this function)
> make[1]: *** [sg/syzkaller1] Error 1
> make[1]: Leaving directory `/root/blktests/src'
> make: *** [all] Error 2
> -----------------------------------------------------------------------------------------------------------------------
>
> It seems that __atomic_* functions are not available, and could you
> tell me how to fix
> the compiler error?

It seems like gcc 4.4 is too old to handle __ATOMIC_*. The oldest
version of gcc I tried was 4.8 which could handle this code perfectly
fine.

I think we need hacks in the makefile to see which compiler version we
have and conditionally compile the code.

Byte,
        Johannes
Xiao Yang Dec. 19, 2017, 10:59 a.m. UTC | #8
On 2017/12/19 18:53, Johannes Thumshirn wrote:
> Xiao Yang<yangx.jy@cn.fujitsu.com>  writes:
>> [root@RHEL6U9GA_Intel64 blktests]# make
>> make -C src all
>> make[1]: Entering directory `/root/blktests/src'
>> cc -Wall -o sg/syzkaller1 -O2 sg/syzkaller1.c
>> sg/syzkaller1.c: In function ‘segv_handler’:
>> sg/syzkaller1.c:118: warning: implicit declaration of function
>> ‘__atomic_load_n’
>> sg/syzkaller1.c:118: error: ‘__ATOMIC_RELAXED’ undeclared (first use
>> in this function)
>> sg/syzkaller1.c:118: error: (Each undeclared identifier is reported
>> only once
>> sg/syzkaller1.c:118: error: for each function it appears in.)
>> sg/syzkaller1.c: In function ‘syz_open_dev’:
>> sg/syzkaller1.c:204: warning: implicit declaration of function
>> ‘__atomic_fetch_add’
>> sg/syzkaller1.c:204: error: ‘__ATOMIC_SEQ_CST’ undeclared (first use
>> in this function)
>> sg/syzkaller1.c:204: warning: implicit declaration of function
>> ‘__atomic_fetch_sub’
>> sg/syzkaller1.c: In function ‘test’:
>> sg/syzkaller1.c:406: error: ‘__ATOMIC_SEQ_CST’ undeclared (first use
>> in this function)
>> make[1]: *** [sg/syzkaller1] Error 1
>> make[1]: Leaving directory `/root/blktests/src'
>> make: *** [all] Error 2
>> -----------------------------------------------------------------------------------------------------------------------
>>
>> It seems that __atomic_* functions are not available, and could you
>> tell me how to fix
>> the compiler error?
> It seems like gcc 4.4 is too old to handle __ATOMIC_*. The oldest
> version of gcc I tried was 4.8 which could handle this code perfectly
> fine.
>
> I think we need hacks in the makefile to see which compiler version we
> have and conditionally compile the code.
Hi Johannes,

Thanks for your quick reply.  i will try to fix it as you suggested.

Thanks,
Xiao Yang
> Byte,
>          Johannes
>



--
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/473 b/tests/generic/473
new file mode 100755
index 0000000..d7998cd
--- /dev/null
+++ b/tests/generic/473
@@ -0,0 +1,83 @@ 
+#! /bin/bash
+# FS QA Test No. 473
+#
+# Regression test for commit:
+# 77032ca ("Return EBUSY from BLKRRPART for mounted whole-dev fs")
+#
+# If the entire block device is formatted with a filesystem and
+# mounted, running "blockdev --rereadpt" should fail and return
+# EBUSY.  On buggy kernel, it passes unexpectedly.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
+# Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmpdir=`mktemp -d`
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 7 15
+
+_cleanup()
+{
+	# Umount
+	$UMOUNT_PROG $tmpdir >>$seqres.full 2>&1
+	# Destroy device
+        _put_scsi_debug_dev
+	rm -rf $tmpdir
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/scsi_debug
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_os Linux
+_require_scsi_debug
+
+# Create and format
+test_dev=`_get_scsi_debug_dev`
+_mkfs_dev $test_dev >>$seqres.full 2>&1
+
+# Mount and check mounted whole-dev
+_mount $test_dev $tmpdir
+
+out=$(blockdev --rereadpt $test_dev 2>&1)
+res=$?
+
+echo $out | grep -q "Unknown command" && \
+	_notrun "blockdev --rereadpt was not supported"
+
+[ $res -eq 0 ] && _fail "blockdev --rereadpt passed when checking mounted whole-dev"
+
+echo $out | grep -q "Device or resource busy" || \
+	_fail "blockdev --rereadpt returned unexpected error when checking mounted whole-dev"
+
+echo $out >> $seqres.full
+
+echo "Silence is golden"
+
+# success, all done
+status=0
+exit
diff --git a/tests/generic/473.out b/tests/generic/473.out
new file mode 100644
index 0000000..854fbcd
--- /dev/null
+++ b/tests/generic/473.out
@@ -0,0 +1,2 @@ 
+QA output created by 473
+Silence is golden
diff --git a/tests/generic/group b/tests/generic/group
index 6c3bb03..54b9404 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -472,3 +472,4 @@ 
 467 auto quick exportfs
 468 shutdown auto quick metadata
 469 auto quick
+473 auto quick blockdev