Commit Graph

10471 Commits

Author SHA1 Message Date
Michael Kerrisk c00ff2dc16 fanotify.7: Add subheading for /proc/PID/fdinfo
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:46:16 +02:00
Michael Kerrisk 679a078389 fanotify.7: Remove a sentence from ETXTBSY description
No file descriptor is actually created...

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:51 +02:00
Michael Kerrisk 68bcc008cc fanotify.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:51 +02:00
Michael Kerrisk 72b9aa964c fanotify.7: Minor wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:51 +02:00
Michael Kerrisk 49894a5a8f fanotify.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:50 +02:00
Michael Kerrisk d7d24d40ec fanotify.7: Add sentence introducing fanotify_response fields
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:50 +02:00
Michael Kerrisk f897ec112f fanotify.7: Minor rewording of FAN_CLOSE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:50 +02:00
Michael Kerrisk f2ac23e758 fanotify.7: Add introductory sentence for explanation of fanotify_event_metadata
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:50 +02:00
Michael Kerrisk ad02dd1f87 fanotify.7: Add a subheading for reading events
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:50 +02:00
Michael Kerrisk 75c3e3bd6b fanotify.7: Move the text on event merging
Place it near the discussion of the events bit mask.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:50 +02:00
Michael Kerrisk 2932564490 fanotify.7: Rework text on event bits a little
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:50 +02:00
Michael Kerrisk c9120323bf fanotify.7: Rework and enhance text introducing read() and events
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:50 +02:00
Michael Kerrisk 6c693f6de5 fanotify.7: Move text describing fanotify_mark()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:50 +02:00
Michael Kerrisk 488cdd819c fanotify.7: Move epoll/poll/select discussion to its own subsection
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:50 +02:00
Michael Kerrisk 7fc5dd9466 fanotify.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:50 +02:00
Michael Kerrisk be8ba5d879 fanotify.7: Rework text on close()
Closing the fanotify FD was discussed in two places.
Merge them into one location, and discard redundant text.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:44:40 +02:00
Michael Kerrisk d3471a460b fanotify.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:43:40 +02:00
Michael Kerrisk 88145b29e7 fanotify.7: Add some subheadings to structure the DESCRIPTION
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:43:40 +02:00
Michael Kerrisk 397ff1fd3f fanotify.7: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:43:40 +02:00
Michael Kerrisk 02a18e0f7f fanotify.7: Reword FAN_CLOSE_NOWRITE text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:43:40 +02:00
Michael Kerrisk 9d76d63060 fanotify.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:43:40 +02:00
Michael Kerrisk 8d2ee5c85d fanotify.7: spfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:43:40 +02:00
Michael Kerrisk 815df19b29 fanotify.7: Declare handle_events() in example code as 'static'
To avoid warning "no previous prototype for..."
when compiling with "-Wmissing-prototypes"

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:43:11 +02:00
Michael Kerrisk b34cbc4530 fanotify.7: Change a comment in example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:43:10 +02:00
Michael Kerrisk def5c668e8 fanotify.7: Merge two printf() calls
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:43:10 +02:00
Michael Kerrisk 48fd9fe08a fanotify.7: Change a comment in example code
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:43:10 +02:00
Michael Kerrisk 8cc4f7a94e fanotify.7: Remove unneeded close() calls
The fanotify file descriptor will be implicitly closed by process
termination, and in any case it was not closed explicitly in all
process termination paths.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 11:42:57 +02:00
Michael Kerrisk f776794974 fanotify.7: Minor tweaks to example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 10:00:53 +02:00
Michael Kerrisk ddb112c281 fanotify.7: Minor fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 09:49:19 +02:00
Michael Kerrisk 6d8c5d015d fanotify.7: Minor fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 09:20:45 +02:00
Michael Kerrisk d9b086d625 fanotify.7: Mention inotify(7) in opening paragraph
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 08:06:41 +02:00
Michael Kerrisk 7ea227bdde fanotify.7: Minor fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 08:06:41 +02:00
Heinrich Schuchardt f75d27e6b0 inotify.7: SEE ALSO: add fanotify(7)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 07:57:41 +02:00
Heinrich Schuchardt c200b422df fanotify_mark.2: New page documenting fanotify_mark(2)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 07:56:49 +02:00
Heinrich Schuchardt 3e6ebb33e5 fanotify_init.2: New page documenting fanotify_init(2)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 07:56:02 +02:00
Heinrich Schuchardt 597aaea2f7 fanotify.7: New page providing overview of the fanotify API
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-25 07:55:05 +02:00
Stefan Puiu a29edaeef6 packet.7: Status in PACKET_RX_RING is actually a bit mask
Stefan:
I'm playing with the PACKET_RX_RING option to packet sockets and I
noticed that the status field from the tpacket_hdr structures
inside the mmaped buffer is actually a bit mask. I'm testing with
4Gbps traffic rates and sometimes I get status=5. I'm using Ubuntu
12.04 with a 3.8.0-29 kernel, and at least from the code (I got it
using "sudo apt-get source linux-image-$(uname -r)") it seems the
5 means TP_STATUS_USER | TP_STATUS_LOSING. The 3.8.0 kernel code
has this line in tpacket_rcv():

    /*
     * LOSING will be reported till you read the stats,
     * because it's COR - Clear On Read.
     * Anyways, moving it for V1/V2 only as V3 doesn't need this
     * at packet level.
     */
            if (po->stats.tp_drops)
                    status |= TP_STATUS_LOSING;

Daniel:
Now to your question. It can easily be seen from the if_packet.h header
file http://lingrok.org/xref/linux-net-next/include/uapi/linux/if_packet.h#93
that TP_STATUS_* are individual bits that are set in tp_status field.

TP_STATUS_USER simply means a frame was received in the ring and is
ready for user space to be processed. If the field also indicates
TP_STATUS_LOSING then this means that there were packet drops in the
rx ring itself so a user knows it didn't get all traffic. This bit
is being reset on getsockopt() when querying PACKET_STATISTICS,
otherwise it stays. Drops occur when the ring buffer was not emptied
fast enough by user space (so no free slot with TP_STATUS_KERNEL), e.g.
due to high incoming traffic load. However, the current frame you're
reading that has TP_STATUS_USER|TP_STATUS_LOSING is fine by itself.

Acked-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Carsten Andrich <carsten.andrich@tu-ilmenau.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-24 11:52:39 +02:00
Michael Kerrisk 84f573db60 rename.2: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-23 20:55:44 +02:00
Michael Kerrisk 8f60952e38 rename.2: Improve wording of renameat2() ENOENT error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-23 20:55:38 +02:00
Michael Kerrisk 5c1517fa0a rename.2: Improve description or renameat2() EINVAL 'flags' error
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-23 20:40:45 +02:00
Michael Kerrisk 4e6c4ab2ff rename.2: Add CONFORMING TO and VERSIONS for renameat2()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-23 20:40:45 +02:00
Miklos Szeredi ab99efddee rename.2: Document renameat2()
Some light edits to this patch by mtk.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-23 20:40:45 +02:00
Michael Kerrisk bf253d9b61 syscalls.2: Add renameat2()
And bump kernel version.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-23 20:40:45 +02:00
Michael Kerrisk 11b520ed8f alloc_hugepages.2, futex.2, vm86.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-23 20:40:01 +02:00
Michael Kerrisk 82e683e6bd msync.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-23 20:40:01 +02:00
Peter Schiffer f6374cc2cd set_mempolicy.2: wfix
Hi Michael,

sending minor wording fix for set_mempolicy(2) man page.

peter

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-23 20:40:00 +02:00
Michael Kerrisk ab80da6e17 packet.7: SEE ALSO: add /tools/testing/selftests/net/psock_tpacket.c
Reported-by: Carsten Andrich <carsten.andrich@tu-ilmenau.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-23 20:40:00 +02:00
Michael Kerrisk 3d4d5a0635 packet.7: Minor tweak to Carsten Andrich's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-23 20:40:00 +02:00
Michael Kerrisk 896333c57e packet.7: Minor fixes to Carsten Andrich's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-23 20:40:00 +02:00
Carsten Andrich 8c26e99bce packet.7: PACKET_LOSS has inverse meaning
I stumbled upon an error in packet.7 regarding the meaning of the
PACKET_LOSS socket option. According to the current git version of
linux-man setting PACKET_LOSS causes malformed packets to *not* be
silently dropped.

However it is the other way round. If PACKET_LOSS is *not* set,
malformed packets will be marked TP_STATUS_WRONG_FORMAT and the
transmission process aborted, leaving untransmitted packets in
the ring.  If it *is* set, malformed packets will be silently
skipped, their status set to TP_STATUS_AVAILABLE and the
transmission process continued with the following packet.

This behaviour can be clearly seen in net/packet/af_packet.c:
http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/net/packet/af_packet.c#n2300

The value accompanying TP_PACKET_LOSS translates into po->tp_loss:
http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/net/packet/af_packet.c#n3304

I inverted the meaning of PACKET_LOSS and clarified the
description in the attached patch.

Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-04-23 20:40:00 +02:00