lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190130153911.GJ2332@uranus.lan>
Date:   Wed, 30 Jan 2019 18:39:11 +0300
From:   Cyrill Gorcunov <gorcunov@...il.com>
To:     LKML <linux-kernel@...r.kernel.org>
Cc:     Al Viro <viro@...iv.linux.org.uk>
Subject: [PATCH next] fs/splice: iter_to_pipe -- Use PIPE_DEF_BUFFERS instead
 of hardcoded number

And use ARRAY_SIZE for easier code modification if we ever need in future.

CC: Al Viro <viro@...iv.linux.org.uk>
Signed-off-by: Cyrill Gorcunov <gorcunov@...il.com>
---
 fs/splice.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-next.git/fs/splice.c
===================================================================
--- linux-next.git.orig/fs/splice.c
+++ linux-next.git/fs/splice.c
@@ -1203,12 +1203,12 @@ static int iter_to_pipe(struct iov_iter
 	bool failed = false;
 
 	while (iov_iter_count(from) && !failed) {
-		struct page *pages[16];
+		struct page *pages[PIPE_DEF_BUFFERS];
 		ssize_t copied;
 		size_t start;
 		int n;
 
-		copied = iov_iter_get_pages(from, pages, ~0UL, 16, &start);
+		copied = iov_iter_get_pages(from, pages, ~0UL, ARRAY_SIZE(pages), &start);
 		if (copied <= 0) {
 			ret = copied;
 			break;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ