syscalls/copy_file_range02: use .needs_tmpdir and MAX_LEN
diff mbox series

Message ID 1566541374-2225-1-git-send-email-xuyang2018.jy@cn.fujitsu.com
State Changes Requested
Headers show
Series
  • syscalls/copy_file_range02: use .needs_tmpdir and MAX_LEN
Related show

Commit Message

Yang Xu Aug. 23, 2019, 6:22 a.m. UTC
Since commit bc514b22, we have removed EXDEV test. all_filesystem
,mount_device and mntpoint make no sense. Remove it and use tmpdir.

As man-page said, when we plan to write at a position past the maximum
allowed offset, it will return EFBIG. So we should USE MAX_LEN as pos
instead of MAX_OFF.

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
---
 .../kernel/syscalls/copy_file_range/copy_file_range02.c     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Li Wang Aug. 23, 2019, 6:55 a.m. UTC | #1
Hi Xu,

Seems you have to apply Petr's patch first, then do a new
modification. Because that patch fixes another compiling issue.

[1] http://lists.linux.it/pipermail/ltp/2019-August/013239.html

--
Regards,
Li Wang
Yang Xu Aug. 23, 2019, 7:13 a.m. UTC | #2
On 2019/08/23 14:55, Li Wang wrote:
> Hi Xu,
>
> Seems you have to apply Petr's patch first, then do a new
> modification. Because that patch fixes another compiling issue.
>
> [1] http://lists.linux.it/pipermail/ltp/2019-August/013239.html
Hi Li


Petr' patch looks ok but I don't know why it isn't merged on master branch.

I am not sure Petr's patch whether having the next version, so I don't rebase it.

IMO, merge Petr's patch then I rebase it. Or Merge my patch then Petr rebases it.
It depends on ltp community.


Thanks
Yang Xu

> --
> Regards,
> Li Wang
>
>
>
Murphy Zhou Aug. 23, 2019, 7:15 a.m. UTC | #3
On Fri, Aug 23, 2019 at 02:22:54PM +0800, Yang Xu wrote:
> Since commit bc514b22, we have removed EXDEV test. all_filesystem
> ,mount_device and mntpoint make no sense. Remove it and use tmpdir.
> 
> As man-page said, when we plan to write at a position past the maximum
> allowed offset, it will return EFBIG. So we should USE MAX_LEN as pos
> instead of MAX_OFF.

Test PASS. Thanks!

> 
> Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
> Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
> ---
>  .../kernel/syscalls/copy_file_range/copy_file_range02.c     | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c b/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c
> index 9004c4a40..f502c75c0 100644
> --- a/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c
> +++ b/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c
> @@ -74,7 +74,7 @@ static struct tcase {
>  	{&fd_chrdev,    0,   EINVAL,     0,     CONTSIZE, "char device"},
>  	{&fd_fifo,      0,   EINVAL,     0,     CONTSIZE, "fifo"},
>  	{&fd_copy,      0,   EOVERFLOW,  MAX_OFF, ULLONG_MAX, "max length lenght"},
> -	{&fd_copy,      0,   EFBIG,      MAX_OFF, MIN_OFF, "max file size"},
> +	{&fd_copy,      0,   EFBIG,      MAX_LEN, MIN_OFF, "max file size"},
>  };
>  
>  static int run_command(char *command, char *option, char *file)
> @@ -219,8 +219,6 @@ static struct tst_test test = {
>  	.setup = setup,
>  	.cleanup = cleanup,
>  	.needs_root = 1,
> -	.mount_device = 1,
> -	.mntpoint = MNTPOINT,
> -	.all_filesystems = 1,
> +	.needs_tmpdir = 1,
>  	.test_variants = TEST_VARIANTS,
>  };
> -- 
> 2.18.1
> 
> 
>
Li Wang Aug. 23, 2019, 7:24 a.m. UTC | #4
Hi Xu,

> Petr' patch looks ok but I don't know why it isn't merged on master branch.

Sorry for the delay, I have just merged that one.
Yang Xu Aug. 23, 2019, 7:29 a.m. UTC | #5
On 2019/08/23 15:24, Li Wang wrote:

> Hi Xu,
>
>> Petr' patch looks ok but I don't know why it isn't merged on master branch.
> Sorry for the delay, I have just merged that one.
>
OK.  I will send a v2 patch.

Patch
diff mbox series

diff --git a/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c b/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c
index 9004c4a40..f502c75c0 100644
--- a/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c
+++ b/testcases/kernel/syscalls/copy_file_range/copy_file_range02.c
@@ -74,7 +74,7 @@  static struct tcase {
 	{&fd_chrdev,    0,   EINVAL,     0,     CONTSIZE, "char device"},
 	{&fd_fifo,      0,   EINVAL,     0,     CONTSIZE, "fifo"},
 	{&fd_copy,      0,   EOVERFLOW,  MAX_OFF, ULLONG_MAX, "max length lenght"},
-	{&fd_copy,      0,   EFBIG,      MAX_OFF, MIN_OFF, "max file size"},
+	{&fd_copy,      0,   EFBIG,      MAX_LEN, MIN_OFF, "max file size"},
 };
 
 static int run_command(char *command, char *option, char *file)
@@ -219,8 +219,6 @@  static struct tst_test test = {
 	.setup = setup,
 	.cleanup = cleanup,
 	.needs_root = 1,
-	.mount_device = 1,
-	.mntpoint = MNTPOINT,
-	.all_filesystems = 1,
+	.needs_tmpdir = 1,
 	.test_variants = TEST_VARIANTS,
 };