* + proc-mandate-proc_lseek-in-struct-proc_ops-fix.patch added to -mm tree
@ 2021-04-09 4:50 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-04-09 4:50 UTC (permalink / raw)
To: adobriyan, mm-commits, willy
The patch titled
Subject: proc: smoke test lseek()
has been added to the -mm tree. Its filename is
proc-mandate-proc_lseek-in-struct-proc_ops-fix.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/proc-mandate-proc_lseek-in-struct-proc_ops-fix.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/proc-mandate-proc_lseek-in-struct-proc_ops-fix.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Alexey Dobriyan <adobriyan@gmail.com>
Subject: proc: smoke test lseek()
Now that ->proc_lseek has been made mandatory it would be nice to test
that nothing has been forgotten.
Link: https://lkml.kernel.org/r/YG4OIhChOrVTPgdN@localhost.localdomain
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
tools/testing/selftests/proc/read.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/tools/testing/selftests/proc/read.c~proc-mandate-proc_lseek-in-struct-proc_ops-fix
+++ a/tools/testing/selftests/proc/read.c
@@ -14,7 +14,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
// Test
-// 1) read of every file in /proc
+// 1) read and lseek on every file in /proc
// 2) readlink of every symlink in /proc
// 3) recursively (1) + (2) for every directory in /proc
// 4) write to /proc/*/clear_refs and /proc/*/task/*/clear_refs
@@ -45,6 +45,8 @@ static void f_reg(DIR *d, const char *fi
fd = openat(dirfd(d), filename, O_RDONLY|O_NONBLOCK);
if (fd == -1)
return;
+ /* struct proc_ops::proc_lseek is mandatory if file is seekable. */
+ (void)lseek(fd, 0, SEEK_SET);
rv = read(fd, buf, sizeof(buf));
assert((0 <= rv && rv <= sizeof(buf)) || rv == -1);
close(fd);
_
Patches currently in -mm which might be from adobriyan@gmail.com are
proc-save-loc-in-__xlate_proc_name.patch
proc-mandate-proc_lseek-in-struct-proc_ops.patch
proc-mandate-proc_lseek-in-struct-proc_ops-fix.patch
proc-delete-redundant-subset=pid-check.patch
proc-test-subset=pid.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-04-09 4:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09 4:50 + proc-mandate-proc_lseek-in-struct-proc_ops-fix.patch added to -mm tree akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).