fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] generic/442: add sync before dmsetup remove
@ 2019-09-25  8:29 Su Yanjun
  2019-09-25 13:08 ` Eryu Guan
  0 siblings, 1 reply; 6+ messages in thread
From: Su Yanjun @ 2019-09-25  8:29 UTC (permalink / raw)
  To: guaneryu; +Cc: fstests, suyj.fnst

This test case sometime fails. Because "dmsetup remove error-test" may
fail when some writeback is going on.

This patch adds sync before dmsetup remove operation.

Signed-off-by: Su Yanjun <suyj.fnst@cn.fujitsu.com>
---
 tests/generic/442 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/generic/442 b/tests/generic/442
index fe6d460..d48ca36 100755
--- a/tests/generic/442
+++ b/tests/generic/442
@@ -43,6 +43,7 @@ $here/src/fsync-err -d $here/src/dmerror $DMERROR_DEV
 
 # success, all done
 _dmerror_load_working_table
+sync
 _dmerror_cleanup
 _scratch_mkfs > $seqres.full 2>&1
 status=0
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] generic/442: add sync before dmsetup remove
  2019-09-25  8:29 [PATCH] generic/442: add sync before dmsetup remove Su Yanjun
@ 2019-09-25 13:08 ` Eryu Guan
  2019-09-26  3:05   ` Su Yanjun
  0 siblings, 1 reply; 6+ messages in thread
From: Eryu Guan @ 2019-09-25 13:08 UTC (permalink / raw)
  To: Su Yanjun; +Cc: fstests

On Wed, Sep 25, 2019 at 04:29:18PM +0800, Su Yanjun wrote:
> This test case sometime fails. Because "dmsetup remove error-test" may
> fail when some writeback is going on.
> 
> This patch adds sync before dmsetup remove operation.
> 
> Signed-off-by: Su Yanjun <suyj.fnst@cn.fujitsu.com>
> ---
>  tests/generic/442 | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/generic/442 b/tests/generic/442
> index fe6d460..d48ca36 100755
> --- a/tests/generic/442
> +++ b/tests/generic/442
> @@ -43,6 +43,7 @@ $here/src/fsync-err -d $here/src/dmerror $DMERROR_DEV

fsync-err should have flipped $DMERROR_DEV to working mode and fsync
each open fd before exit if fsync-err didn't report any failure. So
there should be no on-going writeback.

>  
>  # success, all done
>  _dmerror_load_working_table
> +sync
>  _dmerror_cleanup

And _dmerror_cleanup umount $DMERROR_DEV first, then tear down the dm
device. Could you check if fsync-err returns successfully and umount
succeeds as well?

Thanks,
Eryu

>  _scratch_mkfs > $seqres.full 2>&1
>  status=0
> -- 
> 2.7.4
> 
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] generic/442: add sync before dmsetup remove
  2019-09-25 13:08 ` Eryu Guan
@ 2019-09-26  3:05   ` Su Yanjun
  2019-09-26  5:51     ` Eryu Guan
  0 siblings, 1 reply; 6+ messages in thread
From: Su Yanjun @ 2019-09-26  3:05 UTC (permalink / raw)
  To: Eryu Guan; +Cc: fstests


在 2019/9/25 21:08, Eryu Guan 写道:
> On Wed, Sep 25, 2019 at 04:29:18PM +0800, Su Yanjun wrote:
>> This test case sometime fails. Because "dmsetup remove error-test" may
>> fail when some writeback is going on.
>>
>> This patch adds sync before dmsetup remove operation.
>>
>> Signed-off-by: Su Yanjun <suyj.fnst@cn.fujitsu.com>
>> ---
>>   tests/generic/442 | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/tests/generic/442 b/tests/generic/442
>> index fe6d460..d48ca36 100755
>> --- a/tests/generic/442
>> +++ b/tests/generic/442
>> @@ -43,6 +43,7 @@ $here/src/fsync-err -d $here/src/dmerror $DMERROR_DEV
> fsync-err should have flipped $DMERROR_DEV to working mode and fsync
> each open fd before exit if fsync-err didn't report any failure. So
> there should be no on-going writeback.
>>   
>>   # success, all done
>>   _dmerror_load_working_table
>> +sync
>>   _dmerror_cleanup
> And _dmerror_cleanup umount $DMERROR_DEV first, then tear down the dm
> device. Could you check if fsync-err returns successfully and umount
> succeeds as well?

I cant find any mount info for $DMERROR_DEV in this test. fsync-err  
just does write or sync test with the raw logical dm device.

Am i missing something?

mkfs.xfs: cannot open /dev/sda11: Device or resource busy
device-mapper: remove ioctl on error-test  failed: Device or resource busy
Command failed.
_check_xfs_filesystem: filesystem on /dev/sda11 has dirty log
*** xfs_logprint -t output ***
xfs_logprint: logprint.c:230: main: Assertion `x.logBBsize <= 
0x7fffffff' failed.
*** end xfs_logprint output

 From above log, dmsetup remove failed with "Device or resource busy".

> Thanks,
> Eryu
>
>>   _scratch_mkfs > $seqres.full 2>&1
>>   status=0
>> -- 
>> 2.7.4
>>
>>
>>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] generic/442: add sync before dmsetup remove
  2019-09-26  3:05   ` Su Yanjun
@ 2019-09-26  5:51     ` Eryu Guan
  2019-09-27  1:40       ` Su Yanjun
  0 siblings, 1 reply; 6+ messages in thread
From: Eryu Guan @ 2019-09-26  5:51 UTC (permalink / raw)
  To: Su Yanjun; +Cc: fstests

On Thu, Sep 26, 2019 at 11:05:13AM +0800, Su Yanjun wrote:
> 
> 在 2019/9/25 21:08, Eryu Guan 写道:
> > On Wed, Sep 25, 2019 at 04:29:18PM +0800, Su Yanjun wrote:
> > > This test case sometime fails. Because "dmsetup remove error-test" may
> > > fail when some writeback is going on.
> > > 
> > > This patch adds sync before dmsetup remove operation.
> > > 
> > > Signed-off-by: Su Yanjun <suyj.fnst@cn.fujitsu.com>
> > > ---
> > >   tests/generic/442 | 1 +
> > >   1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/tests/generic/442 b/tests/generic/442
> > > index fe6d460..d48ca36 100755
> > > --- a/tests/generic/442
> > > +++ b/tests/generic/442
> > > @@ -43,6 +43,7 @@ $here/src/fsync-err -d $here/src/dmerror $DMERROR_DEV
> > fsync-err should have flipped $DMERROR_DEV to working mode and fsync
> > each open fd before exit if fsync-err didn't report any failure. So
> > there should be no on-going writeback.
> > >   # success, all done
> > >   _dmerror_load_working_table
> > > +sync
> > >   _dmerror_cleanup
> > And _dmerror_cleanup umount $DMERROR_DEV first, then tear down the dm
> > device. Could you check if fsync-err returns successfully and umount
> > succeeds as well?
> 
> I cant find any mount info for $DMERROR_DEV in this test. fsync-err  just
> does write or sync test with the raw logical dm device.
> 
> Am i missing something?

Ah, sorry, I missed that the test uses raw block device..

> 
> mkfs.xfs: cannot open /dev/sda11: Device or resource busy
> device-mapper: remove ioctl on error-test  failed: Device or resource busy
> Command failed.
> _check_xfs_filesystem: filesystem on /dev/sda11 has dirty log
> *** xfs_logprint -t output ***
> xfs_logprint: logprint.c:230: main: Assertion `x.logBBsize <= 0x7fffffff'
> failed.
> *** end xfs_logprint output
> 
> From above log, dmsetup remove failed with "Device or resource busy".

I can't reproduce above failure with v5.3 kernel, neither xfs nor ext4.
Does ext4 pass in your setup? I suspect it's a kernel bug that still
holds the block device.

Thanks,
Eryu

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] generic/442: add sync before dmsetup remove
  2019-09-26  5:51     ` Eryu Guan
@ 2019-09-27  1:40       ` Su Yanjun
  2019-09-27  1:40         ` Su Yanjun
  0 siblings, 1 reply; 6+ messages in thread
From: Su Yanjun @ 2019-09-27  1:40 UTC (permalink / raw)
  To: Eryu Guan; +Cc: fstests


在 2019/9/26 13:51, Eryu Guan 写道:
> On Thu, Sep 26, 2019 at 11:05:13AM +0800, Su Yanjun wrote:
>> 在 2019/9/25 21:08, Eryu Guan 写道:
>>> On Wed, Sep 25, 2019 at 04:29:18PM +0800, Su Yanjun wrote:
>>>> This test case sometime fails. Because "dmsetup remove error-test" may
>>>> fail when some writeback is going on.
>>>>
>>>> This patch adds sync before dmsetup remove operation.
>>>>
>>>> Signed-off-by: Su Yanjun<suyj.fnst@cn.fujitsu.com>
>>>> ---
>>>>    tests/generic/442 | 1 +
>>>>    1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/tests/generic/442 b/tests/generic/442
>>>> index fe6d460..d48ca36 100755
>>>> --- a/tests/generic/442
>>>> +++ b/tests/generic/442
>>>> @@ -43,6 +43,7 @@ $here/src/fsync-err -d $here/src/dmerror $DMERROR_DEV
>>> fsync-err should have flipped $DMERROR_DEV to working mode and fsync
>>> each open fd before exit if fsync-err didn't report any failure. So
>>> there should be no on-going writeback.
>>>>    # success, all done
>>>>    _dmerror_load_working_table
>>>> +sync
>>>>    _dmerror_cleanup
>>> And _dmerror_cleanup umount $DMERROR_DEV first, then tear down the dm
>>> device. Could you check if fsync-err returns successfully and umount
>>> succeeds as well?
>> I cant find any mount info for $DMERROR_DEV in this test. fsync-err  just
>> does write or sync test with the raw logical dm device.
>>
>> Am i missing something?
> Ah, sorry, I missed that the test uses raw block device..
>
>> mkfs.xfs: cannot open /dev/sda11: Device or resource busy
>> device-mapper: remove ioctl on error-test  failed: Device or resource busy
>> Command failed.
>> _check_xfs_filesystem: filesystem on /dev/sda11 has dirty log
>> *** xfs_logprint -t output ***
>> xfs_logprint: logprint.c:230: main: Assertion `x.logBBsize <= 0x7fffffff'
>> failed.
>> *** end xfs_logprint output
>>
>>  From above log, dmsetup remove failed with "Device or resource busy".
> I can't reproduce above failure with v5.3 kernel, neither xfs nor ext4.
> Does ext4 pass in your setup? I suspect it's a kernel bug that still
> holds the block device.

Yes, ext4 can pass. Only in RHEL release it tests failed.

Maybe "sync" is only a workaround for the the case, the root cause is 
unknown.

It may need more time to analysis.

Thanks

> Thanks,
> Eryu
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] generic/442: add sync before dmsetup remove
  2019-09-27  1:40       ` Su Yanjun
@ 2019-09-27  1:40         ` Su Yanjun
  0 siblings, 0 replies; 6+ messages in thread
From: Su Yanjun @ 2019-09-27  1:40 UTC (permalink / raw)
  To: Eryu Guan; +Cc: fstests


在 2019/9/26 13:51, Eryu Guan 写道:
> On Thu, Sep 26, 2019 at 11:05:13AM +0800, Su Yanjun wrote:
>> 在 2019/9/25 21:08, Eryu Guan 写道:
>>> On Wed, Sep 25, 2019 at 04:29:18PM +0800, Su Yanjun wrote:
>>>> This test case sometime fails. Because "dmsetup remove error-test" may
>>>> fail when some writeback is going on.
>>>>
>>>> This patch adds sync before dmsetup remove operation.
>>>>
>>>> Signed-off-by: Su Yanjun<suyj.fnst@cn.fujitsu.com>
>>>> ---
>>>>    tests/generic/442 | 1 +
>>>>    1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/tests/generic/442 b/tests/generic/442
>>>> index fe6d460..d48ca36 100755
>>>> --- a/tests/generic/442
>>>> +++ b/tests/generic/442
>>>> @@ -43,6 +43,7 @@ $here/src/fsync-err -d $here/src/dmerror $DMERROR_DEV
>>> fsync-err should have flipped $DMERROR_DEV to working mode and fsync
>>> each open fd before exit if fsync-err didn't report any failure. So
>>> there should be no on-going writeback.
>>>>    # success, all done
>>>>    _dmerror_load_working_table
>>>> +sync
>>>>    _dmerror_cleanup
>>> And _dmerror_cleanup umount $DMERROR_DEV first, then tear down the dm
>>> device. Could you check if fsync-err returns successfully and umount
>>> succeeds as well?
>> I cant find any mount info for $DMERROR_DEV in this test. fsync-err  just
>> does write or sync test with the raw logical dm device.
>>
>> Am i missing something?
> Ah, sorry, I missed that the test uses raw block device..
>
>> mkfs.xfs: cannot open /dev/sda11: Device or resource busy
>> device-mapper: remove ioctl on error-test  failed: Device or resource busy
>> Command failed.
>> _check_xfs_filesystem: filesystem on /dev/sda11 has dirty log
>> *** xfs_logprint -t output ***
>> xfs_logprint: logprint.c:230: main: Assertion `x.logBBsize <= 0x7fffffff'
>> failed.
>> *** end xfs_logprint output
>>
>>  From above log, dmsetup remove failed with "Device or resource busy".
> I can't reproduce above failure with v5.3 kernel, neither xfs nor ext4.
> Does ext4 pass in your setup? I suspect it's a kernel bug that still
> holds the block device.

Yes, ext4 can pass. Only in RHEL release it tests failed.

Maybe "sync" is only a workaround for the the case, the root cause is 
unknown.

It may need more time to analysis.

Thanks

> Thanks,
> Eryu
>
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-09-27  1:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25  8:29 [PATCH] generic/442: add sync before dmsetup remove Su Yanjun
2019-09-25 13:08 ` Eryu Guan
2019-09-26  3:05   ` Su Yanjun
2019-09-26  5:51     ` Eryu Guan
2019-09-27  1:40       ` Su Yanjun
2019-09-27  1:40         ` Su Yanjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).