Commit Graph

20891 Commits

Author SHA1 Message Date
Yang Shi e7b72190bb move_pages.2: Returning positive value is a new error case
Since commit a49bd4d71637 ("mm, numa: rework do_pages_move"), the
semantic of move_pages() has changed to return the number of
non-migrated pages if they were result of a non-fatal reasons
(usually a busy page).  This was an unintentional change that
hasn't been noticed except for LTP tests which checked for the
documented behavior.

There are two ways to go around this change.  We can even get back
to the original behavior and return -EAGAIN whenever migrate_pages
is not able to migrate pages due to non-fatal reasons.  Another
option would be to simply continue with the changed semantic and
extend move_pages documentation to clarify that -errno is returned
on an invalid input or when migration simply cannot succeed (e.g.
-ENOMEM, -EBUSY) or the number of pages that couldn't have been
migrated due to ephemeral reasons (e.g. page is pinned or locked
for other reasons).

We decided to keep the second option in kernel because this
behavior is in place for some time without anybody complaining and
possibly new users depending on it.  Also it allows to have a
slightly easier error handling as the caller knows that it is
worth to retry when err > 0.

Update man pages to reflect the new semantic.

Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 13:30:02 +02:00
Michael Kerrisk c8bbab9a6a namespaces.7: Document /proc/sys/user/max_time_namespaces
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 13:25:02 +02:00
Michael Kerrisk c96bc2056c namespaces.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 13:23:44 +02:00
Michael Kerrisk 40ce741410 getauxval.3: Minor tweaks to YunQiang Su's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 13:13:12 +02:00
YunQiang Su 685385df91 getauxval.3: MIPS, AT_BASE_PLATFORM passes ISA level
Since Linux 5.7, on MIPS, we use AT_BASE_PLATFORM to pass ISA level.
The values may be:
  mips2, mips3, mips4, mips5,
  mips32, mips32r2, mips32r6,
  mips64, mips64r2, mips64r6.

This behavior is different with PowerPC.

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=e585b768da111f2c2d413de6214e83bbdfee8f22
Signed-off-by: YunQiang Su <syq@debian.org>

----
v1 -> v2: fix typo

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 13:12:02 +02:00
Michael Kerrisk 34451e6ee4 s390_runtime_instr.2: Various reworking of Heiko Carstens's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 12:30:00 +02:00
Michael Kerrisk fee6e6795e s390_runtime_instr.2: srcfix: rewrap long source lines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 12:18:19 +02:00
Heiko Carstens cca27058b7 s390_runtime_instr.2: Document signum argument behavior change
Document that the signum argument is ignored in newer kernels, but
that user space should pass a valid real-time signal number for
backwards compatibility.

Cowritten-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Eugene Syromyatnikov <evgsyr@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 12:10:07 +02:00
Michael Kerrisk bff15b74e0 msgctl.2: Correct description of 'msg_ctime' field
Verified by inspecting kernel source.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 11:48:08 +02:00
Michael Kerrisk 6cd15a0567 shmctl.2: f
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 11:47:16 +02:00
Michael Kerrisk a85bc85d5d shmctl.2: Correct 'shm_ctime' description
Verified from kernel sources.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 11:41:47 +02:00
Michael Kerrisk 5fd4345e84 semctl.2: Correct description of sem_ctime field
Verified from inspection of kernel source code.

Reported-by: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 11:33:17 +02:00
Michael Kerrisk 6fea5f4f1d semctl.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 11:27:19 +02:00
Michael Kerrisk 191dd3b238 mremap.2: Remove mention of "Segmentation fault" in EFAULT text
"Segmentation fault" (SIGSEGV) is not exactly the same thing as
EFAULT.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 08:23:09 +02:00
Michael Kerrisk 4737f0d145 mremap.2: Move a paragraph on MREMAP_DONTUNMAP from NOTES to DESCRIPTION
I think things read slightly easier, if all of the info on
MREMAP_DONTUNMAP is in one place.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 08:21:30 +02:00
Michael Kerrisk f15e32e3b9 mremap.2: Move a paragraph from DESCRIPTION to NOTES
The paragraph on Linux VM is rather generic, and does not belong
in DESCRIPTION. In fact, I'm not sure it even belongs in this
page.  At the least, let's move it to NOTES.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 08:20:12 +02:00
Michael Kerrisk 8c97c565ee mremap.2: Move a paragraph from DESCRIPTION to NOTES
And while we are at it, remove a sentence that makes an obvious
point (that mremap() uses the Linux page table scheme).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 08:20:12 +02:00
Michael Kerrisk 2b4fecb9f6 mremap.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 08:20:12 +02:00
Michael Kerrisk 6af75e77bb mremap.2: Reorder some paragraphs in NOTES
Details of glibc 2.4, which is by now fairly old, would be
better at the end of NOTES than at the start.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 08:20:12 +02:00
Michael Kerrisk 0f0993c9b5 mremap.2: Some more improvements to Brian Geffon's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 08:20:01 +02:00
Michael Kerrisk 452bdc2f02 mremap.2: Minor tweaks to Brian Geffon's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 07:30:00 +02:00
Brian Geffon 8debc4f595 mremap.2: Document MREMAP_DONTUNMAP
Signed-off-by: Brian Geffon <bgeffon@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 07:30:00 +02:00
Michael Kerrisk cb76d6e5fe mremap.2: ffix (Add a paragraph break)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-16 07:30:00 +02:00
Michael Kerrisk 2932c4aa7e openat2.2: A few more fixes after feedback from Aleksa Sarai
Reported-by: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 22:07:39 +02:00
Michael Kerrisk 9154da7f05 mmap.2: Don't mark MAP_ANON as deprecated
From a mailing list conversation:

On 5/24/18 9:03 PM, Heinrich Schuchardt wrote:
> Hello Michael,
>
> in the mmap(2) man page MAP_ANON is described as deprecated.
>
> When I look at the NetBSD manpage
> http://netbsd.gw.com/cgi-bin/man-cgi?mmap+2+NetBSD-current
> I found that MAP_ANONYMOUS is not defined.
>
> https://www.dragonflybsd.org/cgi/web-man?command=mmap&section=2
> indicates MAP_ANONYMOUS is an alias for MAP_ANON and is provided for
> compatibility.
>
> https://man.openbsd.org/mmap.2 also knows MAP_ANONYMOUS as a synonym.
>
> https://www.unix.com/man-page/osx/2/mmap/ does not know MAP_ANONYMOUS.
>
> So shouldn't the man page indicate that MAP_ANON is to be favored to
> write portable code? And correspondingly mark MAP_ANONYMOUS as synonym
> only kept for compatibility.
>
> The Open Group Base Specifications Issue 7, 2018 Edition does not
> reference either of both. So both values are not POSIX but it is not
> correct to describe them as Linux only.

The text saying that MAP_ANON is deprecated is ancient (at least
20 years old). I don't know why that text was added.

Things are not simple though: it looks like there's at least
one historical implementation (HP-US) that defines MAP_ANONYMOUS
but not MAP_ANON.

I've applied the patch below.

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 21:14:12 +02:00
Michael Kerrisk ebf3a7d52a ioctl_list.2: Remove hex values from constants
As noted by Heinrich Schuchardt:

he list contains hex values of different constants. I just wonder for
which architecture (alpha, i386, mips, or sparc at that time). No
information is supplied.

Current values depend on the architecture, e.g.

On amd64
0x82307201      VFAT_IOCTL_READDIR_BOTH
0x82307202      VFAT_IOCTL_READDIR_SHORT
0x80047210      FAT_IOCTL_GET_ATTRIBUTES
0x40047211      FAT_IOCTL_SET_ATTRIBUTES
0x80047213      FAT_IOCTL_GET_VOLUME_ID

On mips
0x42187201      VFAT_IOCTL_READDIR_BOTH
0x42187202      VFAT_IOCTL_READDIR_SHORT
0x40047210      FAT_IOCTL_GET_ATTRIBUTES
0x80047211      FAT_IOCTL_SET_ATTRIBUTES
0x40047213      FAT_IOCTL_GET_VOLUME_ID

Hence hex values should be removed.

Reported-by:
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 13:06:24 +02:00
Michael Kerrisk 5757667555 ld.so.8: ffix
Reported-by: Branden Robinson <g.branden.robinson@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 11:59:14 +02:00
Michael Kerrisk dfa3ae9b3f getdents.2: Tweaks to Petr Vorel's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 11:42:21 +02:00
Petr Vorel f5f6969dee getdents.2: Mention glibc support for getdents64()
Support was added in glibc 2.30.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 11:38:39 +02:00
Chris Lamb 15a8a16b8e getdents.2: Correct linux_dirent definition in example code
It is "unsigned long" earlier up in the file

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 11:36:51 +02:00
Goldwyn Rodrigues 1083ffb4cb utimensat: Immutable flag returns EPERM
Linux kernel commit 337684a1746f "fs: return EPERM on immutable
inode" changed (nd unified the return value of the utimensat(2)
from -EACCES to -EPERM in case of an immutable flag. Modify the
man page to reflect the same.

The entire discussion of returning the correct return value is at:
http://lists.linux.it/pipermail/ltp/2017-January/003424.html

[mtk: The change was in Linux 4.8]

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 10:38:58 +02:00
Urs Thuermann 6193e7abb8 strftime.3: ISO week number can be 52, add example
A year cannot only begin with week number 53 of the previous year but
also with week number 52.  Year 2011 is an example for this case, as
can be easily seen with GNU date:

$ date -d "jan 1 2011" "+%c %V %G"
Sat Jan  1 00:00:00 2011 52 2010

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 09:02:07 +02:00
Michael Kerrisk d7695b17b1 arch_prctl.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-14 08:36:07 +02:00
Michael Kerrisk d9e7db1b39 open.2: Tweaks to Joseph Sible's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:48 +02:00
Joseph C. Sible 2ddf885a4f open.2: Document fs.protected_fifos and fs.protected_regular
The sysctls fs.protected_fifos and fs.protected_regular can cause
open(2) to fail with EACCES (see Documentation/sysctl/fs.rst for
details.)

Signed-off-by: Joseph C. Sible <josephcsible@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:48 +02:00
Michael Kerrisk 03306e1829 proc.5: Document /proc/sys/fs/protected_regular
Text heavily based on Documentation/admin-guide/sysctl/fs.rst.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:48 +02:00
Michael Kerrisk 7dcb9d213a proc.5: Document /proc/sys/fs/protected_fifos
Text heavily based on Documentation/admin-guide/sysctl/fs.rst.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:48 +02:00
Michael Kerrisk 43c257eaf3 io_setup.2: Tweak description of /proc/sys/fs/aio-max-nr
As far as I can see, /proc/sys/fs/aio-max-nr is a
system-wide limit, not a per-user limit. This seems to be
confirmed by comments in fs/aio.c (Linux 5.6) sources).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:48 +02:00
Michael Kerrisk 9f51687a32 proc.5: Document /proc/sys/fs/aio-max-nr and /proc/sys/fs/aio-nr
Text taken nearly verbatim from
Documentation/admin-guide/sysctl/fs.rst.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:47 +02:00
Michael Kerrisk 10e29c059b sendfile.2: wfix
Reported-by: Joseph C. Sible <josephcsible@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:47 +02:00
Michael Kerrisk 3220cf5f7e signal.7: srcfix: note some implementation-specific details for process-directed signals
Reported-by: Joseph C. Sible <josephcsible@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:47 +02:00
Michael Kerrisk 731192bee0 ptrace.2: srcfix: mention strace's linux/*/set_scno.c files in relation to PTRACE_SET_SYSCALL
Reported-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:47 +02:00
Michael Kerrisk cbda5fc9de ptrace.2: Minor tweaks to Joseph Sible's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:44 +02:00
Joseph C. Sible c2254484e3 ptrace.2: Document PTRACE_SET_SYSCALL
Signed-off-by: Joseph C. Sible <josephcsible@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 10:29:03 +02:00
Michael Kerrisk 84eb2279b1 proc.5: Minor tweaks to Keno Fischer's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 09:25:42 +02:00
Keno Fischer 6a036b00bd proc.5: Fix an outdated note about map_files
The restriction to CAP_SYS_ADMIN was removed from map_files in
2015 [1].  There was a fixme that indicted this might happen, but
the main text was never updated when this commit landed. While
we're at it, add a note about the ptrace access check that is
still required.

[1] bdb4d100af

Signed-off-by: Keno Fischer <keno@juliacomputing.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 09:25:22 +02:00
Michael Kerrisk d31cdf430e openat2.2: Various changes after feedback from Aleksa Sarai
Reported-by: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 09:21:20 +02:00
Michael Kerrisk e7722772c3 README: Remove "Man page overlap and duplication" section
The info here is mostly ancient, certainly incomplete,
and is not consistently maintained. Best to remove it, I think.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 09:06:45 +02:00
Michael Kerrisk 70d9d96aeb README: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 07:16:56 +02:00
Michael Kerrisk 1718760f88 README: Add section on "Bug reports and contributing"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-12 23:09:25 +02:00