Skip to contentSkip to conversation

syscalls/copy_file_range02: use .needs_tmpdir and MAX_LEN

PATCH New Yang Xu 3 participants 6 messages Aug 23, 2019

lore
Share & tools
lore

Yang Xu

author
#0 lore raw

PATCH 1/1 syscalls/copy_file_range02: use .needs_tmpdir and MAX_LEN

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.

---
 .../kernel/syscalls/copy_file_range/copy_file_range02.c     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
testcases/kernel/syscalls/copy_file_range/copy_file_range02.c +2 -4
index 9004c4a40..f502c75c0 100644
@@ -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,
 };
Signature · 1 line
2.18.1
author
#2 lore raw

PATCH 1/1 syscalls/copy_file_range02: use .needs_tmpdir and MAX_LEN

Quoted 6 lines · Li Wang

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

Quoted 6 lines

--
Regards,
Li Wang

#3 lore raw

PATCH 1/1 syscalls/copy_file_range02: use .needs_tmpdir and MAX_LEN

Hi Xu,

Quoted 1 line

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.

Signature · 2 lines
Regards,
Li Wang
author
#4 lore raw

PATCH 1/1 syscalls/copy_file_range02: use .needs_tmpdir and MAX_LEN

Quoted 5 lines · Li Wang

Hi Xu,

Quoted 1 line

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.

#5 lore raw

PATCH 1/1 syscalls/copy_file_range02: use .needs_tmpdir and MAX_LEN

In reply to Yang Xu
Quoted 6 lines · Yang Xu

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!

Quoted 35 lines
---
 .../kernel/syscalls/copy_file_range/copy_file_range02.c     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
testcases/kernel/syscalls/copy_file_range/copy_file_range02.c +2 -4
index 9004c4a40..f502c75c0 100644
@@ -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,
 };
Signature · 1 line
2.18.1