diff mbox series

generic/{569,570}: Filter pwrite64

Message ID 1571992470-10289-1-git-send-email-xuyang2018.jy@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show
Series generic/{569,570}: Filter pwrite64 | expand

Commit Message

Yang Xu Oct. 25, 2019, 8:34 a.m. UTC
When I backport fix commits into old kernel, pwrite action will report
"pwrite64: Text file busy". Since xfsprogs without commit 2f9a125c3a39 
("xfsprogs: replace pread64/pwrite64 by equivalent pread/pwrite"),
it will report pwrite64. I think these kernel patchs are simple, old kernel
with lower version xfsprogs may backport these commits. So filter it.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 tests/generic/569 | 4 ++--
 tests/generic/570 | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Eryu Guan Oct. 25, 2019, 8:54 a.m. UTC | #1
On Fri, Oct 25, 2019 at 04:34:30PM +0800, Yang Xu wrote:
> When I backport fix commits into old kernel, pwrite action will report
> "pwrite64: Text file busy". Since xfsprogs without commit 2f9a125c3a39 
> ("xfsprogs: replace pread64/pwrite64 by equivalent pread/pwrite"),
> it will report pwrite64. I think these kernel patchs are simple, old kernel
> with lower version xfsprogs may backport these commits. So filter it.
> 
> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
> ---
>  tests/generic/569 | 4 ++--
>  tests/generic/570 | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/generic/569 b/tests/generic/569
> index 02fd8574..651af02f 100755
> --- a/tests/generic/569
> +++ b/tests/generic/569
> @@ -52,8 +52,8 @@ done
>  swapon $testfile 2>&1 | _filter_scratch
>  
>  # Can we write to it?
> -$XFS_IO_PROG -c 'pwrite -S 0x59 64k 64k' $testfile
> -$XFS_IO_PROG -d -c 'pwrite -S 0x60 64k 64k' $testfile
> +$XFS_IO_PROG -c 'pwrite -S 0x59 64k 64k' $testfile 2>&1 | sed -e "s/pwrite64/pwrite/"
> +$XFS_IO_PROG -d -c 'pwrite -S 0x60 64k 64k' $testfile 2>&1 | sed -e "s/pwrite64/pwrite/"

Ah, I forgot about this error message inconsistency in review.. thanks
for the fix!

But there's already a filter to do this, _filter_xfs_io_error, you could
use it directly.

Thanks,
Eryu

>  $XFS_IO_PROG -c 'mmap -rw 64k 64k' -c 'mwrite -S 0x61 64k 64k' $testfile
>  
>  # Can we change the file size?
> diff --git a/tests/generic/570 b/tests/generic/570
> index 1c5f39f1..43ca5c0b 100755
> --- a/tests/generic/570
> +++ b/tests/generic/570
> @@ -47,8 +47,8 @@ done
>  swapon $SCRATCH_DEV 2>&1 | _filter_scratch
>  
>  # Can we write to it?
> -$XFS_IO_PROG -c 'pwrite -S 0x59 64k 64k' $SCRATCH_DEV
> -$XFS_IO_PROG -d -c 'pwrite -S 0x60 64k 64k' $SCRATCH_DEV
> +$XFS_IO_PROG -c 'pwrite -S 0x59 64k 64k' $SCRATCH_DEV 2>&1 | sed -e "s/pwrite64/pwrite/"
> +$XFS_IO_PROG -d -c 'pwrite -S 0x60 64k 64k' $SCRATCH_DEV 2>&1 | sed -e "s/pwrite64/pwrite/"
>  $XFS_IO_PROG -c 'mmap -rw 64k 64k' -c 'mwrite -S 0x61 64k 64k' $SCRATCH_DEV
>  
>  # success, all done
> -- 
> 2.18.0
> 
>
Yang Xu Oct. 25, 2019, 9:02 a.m. UTC | #2
on 2019/10/25 16:54, Eryu Guan wrote:
> On Fri, Oct 25, 2019 at 04:34:30PM +0800, Yang Xu wrote:
>> When I backport fix commits into old kernel, pwrite action will report
>> "pwrite64: Text file busy". Since xfsprogs without commit 2f9a125c3a39
>> ("xfsprogs: replace pread64/pwrite64 by equivalent pread/pwrite"),
>> it will report pwrite64. I think these kernel patchs are simple, old kernel
>> with lower version xfsprogs may backport these commits. So filter it.
>>
>> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
>> ---
>>   tests/generic/569 | 4 ++--
>>   tests/generic/570 | 4 ++--
>>   2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/tests/generic/569 b/tests/generic/569
>> index 02fd8574..651af02f 100755
>> --- a/tests/generic/569
>> +++ b/tests/generic/569
>> @@ -52,8 +52,8 @@ done
>>   swapon $testfile 2>&1 | _filter_scratch
>>   
>>   # Can we write to it?
>> -$XFS_IO_PROG -c 'pwrite -S 0x59 64k 64k' $testfile
>> -$XFS_IO_PROG -d -c 'pwrite -S 0x60 64k 64k' $testfile
>> +$XFS_IO_PROG -c 'pwrite -S 0x59 64k 64k' $testfile 2>&1 | sed -e "s/pwrite64/pwrite/"
>> +$XFS_IO_PROG -d -c 'pwrite -S 0x60 64k 64k' $testfile 2>&1 | sed -e "s/pwrite64/pwrite/"
> 
> Ah, I forgot about this error message inconsistency in review.. thanks
> for the fix!
> 
> But there's already a filter to do this, _filter_xfs_io_error, you could
> use it directly.
OK. I will use _filter_xfs_io_error in my v2 patch.
> 
> Thanks,
> Eryu
> 
>>   $XFS_IO_PROG -c 'mmap -rw 64k 64k' -c 'mwrite -S 0x61 64k 64k' $testfile
>>   
>>   # Can we change the file size?
>> diff --git a/tests/generic/570 b/tests/generic/570
>> index 1c5f39f1..43ca5c0b 100755
>> --- a/tests/generic/570
>> +++ b/tests/generic/570
>> @@ -47,8 +47,8 @@ done
>>   swapon $SCRATCH_DEV 2>&1 | _filter_scratch
>>   
>>   # Can we write to it?
>> -$XFS_IO_PROG -c 'pwrite -S 0x59 64k 64k' $SCRATCH_DEV
>> -$XFS_IO_PROG -d -c 'pwrite -S 0x60 64k 64k' $SCRATCH_DEV
>> +$XFS_IO_PROG -c 'pwrite -S 0x59 64k 64k' $SCRATCH_DEV 2>&1 | sed -e "s/pwrite64/pwrite/"
>> +$XFS_IO_PROG -d -c 'pwrite -S 0x60 64k 64k' $SCRATCH_DEV 2>&1 | sed -e "s/pwrite64/pwrite/"
>>   $XFS_IO_PROG -c 'mmap -rw 64k 64k' -c 'mwrite -S 0x61 64k 64k' $SCRATCH_DEV
>>   
>>   # success, all done
>> -- 
>> 2.18.0
>>
>>
> 
>
diff mbox series

Patch

diff --git a/tests/generic/569 b/tests/generic/569
index 02fd8574..651af02f 100755
--- a/tests/generic/569
+++ b/tests/generic/569
@@ -52,8 +52,8 @@  done
 swapon $testfile 2>&1 | _filter_scratch
 
 # Can we write to it?
-$XFS_IO_PROG -c 'pwrite -S 0x59 64k 64k' $testfile
-$XFS_IO_PROG -d -c 'pwrite -S 0x60 64k 64k' $testfile
+$XFS_IO_PROG -c 'pwrite -S 0x59 64k 64k' $testfile 2>&1 | sed -e "s/pwrite64/pwrite/"
+$XFS_IO_PROG -d -c 'pwrite -S 0x60 64k 64k' $testfile 2>&1 | sed -e "s/pwrite64/pwrite/"
 $XFS_IO_PROG -c 'mmap -rw 64k 64k' -c 'mwrite -S 0x61 64k 64k' $testfile
 
 # Can we change the file size?
diff --git a/tests/generic/570 b/tests/generic/570
index 1c5f39f1..43ca5c0b 100755
--- a/tests/generic/570
+++ b/tests/generic/570
@@ -47,8 +47,8 @@  done
 swapon $SCRATCH_DEV 2>&1 | _filter_scratch
 
 # Can we write to it?
-$XFS_IO_PROG -c 'pwrite -S 0x59 64k 64k' $SCRATCH_DEV
-$XFS_IO_PROG -d -c 'pwrite -S 0x60 64k 64k' $SCRATCH_DEV
+$XFS_IO_PROG -c 'pwrite -S 0x59 64k 64k' $SCRATCH_DEV 2>&1 | sed -e "s/pwrite64/pwrite/"
+$XFS_IO_PROG -d -c 'pwrite -S 0x60 64k 64k' $SCRATCH_DEV 2>&1 | sed -e "s/pwrite64/pwrite/"
 $XFS_IO_PROG -c 'mmap -rw 64k 64k' -c 'mwrite -S 0x61 64k 64k' $SCRATCH_DEV
 
 # success, all done