Skip to contentSkip to conversation

syscalls/copy_file_range02: correct wrong loop_devn judgment

PATCH New Yang Xu 2 participants 2 messages Aug 2, 2019

lore
Share & tools
lore

Yang Xu

author
#0 lore raw

PATCH 1/1 syscalls/copy_file_range02: correct wrong loop_devn judgment

We should open dev_path when loop_devn is not equal to -1. Since Amir has pointed this obvious error on v6, I forgot it. Sorry for everyone.

Cc Amir Goldstein <[email protected]>
---
 testcases/kernel/syscalls/copy_file_range/copy_file_range02.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/copy_file_range/copy_file_range02.c +1 -1
index 36976156e..26bfa008a 100644
@@ -180,7 +180,7 @@ static void setup(void)
 	fd_immutable = SAFE_OPEN(FILE_IMMUTABLE_PATH, O_RDWR | O_CREAT, 0664);
 	fd_swapfile = SAFE_OPEN(FILE_SWAP_PATH, O_RDWR | O_CREAT, 0600);
 
-	if (loop_devn == -1)
+	if (loop_devn != -1)
 		fd_blkdev = SAFE_OPEN(dev_path, O_RDWR, 0600);
 
 	fd_chrdev = SAFE_OPEN(FILE_CHRDEV, O_RDWR, 0600);
Signature · 1 line
2.18.1
#1 lore raw

PATCH 1/1 syscalls/copy_file_range02: correct wrong loop_devn judgment

Quoted 3 lines · Yang Xu

We should open dev_path when loop_devn is not equal to -1. Since Amir has pointed this obvious error on v6, I forgot it. Sorry for everyone.

Hi Xu,

Pushed, thanks.

Best Regards,
Xiao Yang