* [patch -mm 0/4] Fixes for fdinfo output and docs
@ 2012-11-22 21:15 Cyrill Gorcunov
2012-11-22 21:15 ` [patch -mm 1/4] fs, notify: Add missing space after prefix Cyrill Gorcunov
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Cyrill Gorcunov @ 2012-11-22 21:15 UTC (permalink / raw)
To: Andrew Morton
Cc: Al Viro, Alexey Dobriyan, Pavel Emelyanov, James Bottomley,
Matthew Helsley, aneesh.kumar, bfields, oleg, rientjes,
tvrtko.ursulin, linux-kernel
Hi Andrew, here are few nit-fixes for /proc/<pid>/fdinfo/<fd> handlers and
I tried to write some documentation about the format used in output. I guess
Documentation/filesystems/proc.txt is the best place for it since the
information is rendered via procfs inteface.
Guys, I would really appreciate to feedback on documentation changes and
complains are quite welcome here.
(As to one of previous feedback
| btw, Documentation/sysctl/fs.txt is missing documentation for
| max_user_instances and max_queued_events. Perhaps you can fix that
| when providing the documentation changes for your patch.
I remember about it and will cook patch soon).
Cyrill
^ permalink raw reply [flat|nested] 7+ messages in thread
* [patch -mm 1/4] fs, notify: Add missing space after prefix
2012-11-22 21:15 [patch -mm 0/4] Fixes for fdinfo output and docs Cyrill Gorcunov
@ 2012-11-22 21:15 ` Cyrill Gorcunov
2012-11-22 21:15 ` [patch -mm 2/4] fs, epoll: Drop enabled field from fdinfo output Cyrill Gorcunov
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Cyrill Gorcunov @ 2012-11-22 21:15 UTC (permalink / raw)
To: Andrew Morton
Cc: Al Viro, Alexey Dobriyan, Pavel Emelyanov, James Bottomley,
Matthew Helsley, aneesh.kumar, bfields, oleg, rientjes,
tvrtko.ursulin, linux-kernel, Cyrill Gorcunov, Andrey Vagin,
Al Viro
[-- Attachment #1: seq-fdinfo-fsnotify-11-update --]
[-- Type: text/plain, Size: 1461 bytes --]
While being prepared the first series I occasionally
left "inotify-wd" token not updated. This patch fixes
it and bring space between prefix and the rest of line
back.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Pavel Emelyanov <xemul@parallels.com>
CC: Oleg Nesterov <oleg@redhat.com>
CC: Andrey Vagin <avagin@openvz.org>
CC: Al Viro <viro@ZenIV.linux.org.uk>
CC: Alexey Dobriyan <adobriyan@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: James Bottomley <jbottomley@parallels.com>
CC: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
CC: Alexey Dobriyan <adobriyan@gmail.com>
CC: Matthew Helsley <matt.helsley@gmail.com>
CC: "J. Bruce Fields" <bfields@fieldses.org>
CC: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
CC: Tvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
---
fs/notify/fdinfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6.git/fs/notify/fdinfo.c
===================================================================
--- linux-2.6.git.orig/fs/notify/fdinfo.c
+++ linux-2.6.git/fs/notify/fdinfo.c
@@ -86,7 +86,7 @@ static int inotify_fdinfo(struct seq_fil
inode_mark = container_of(mark, struct inotify_inode_mark, fsn_mark);
inode = igrab(mark->i.inode);
if (inode) {
- ret = seq_printf(m, "inotify-wd:%x ino:%lx sdev:%x "
+ ret = seq_printf(m, "inotify wd:%x ino:%lx sdev:%x "
"mask:%x ignored_mask:%x ",
inode_mark->wd, inode->i_ino,
inode->i_sb->s_dev,
^ permalink raw reply [flat|nested] 7+ messages in thread
* [patch -mm 2/4] fs, epoll: Drop enabled field from fdinfo output
2012-11-22 21:15 [patch -mm 0/4] Fixes for fdinfo output and docs Cyrill Gorcunov
2012-11-22 21:15 ` [patch -mm 1/4] fs, notify: Add missing space after prefix Cyrill Gorcunov
@ 2012-11-22 21:15 ` Cyrill Gorcunov
2012-11-22 21:15 ` [patch -mm 3/4] fs, notify: Dont forget to provide fhandle for inode fanotify Cyrill Gorcunov
2012-11-22 21:15 ` [patch -mm 4/4] docs: Add documentation about /proc/<pid>/fdinfo/<fd> output Cyrill Gorcunov
3 siblings, 0 replies; 7+ messages in thread
From: Cyrill Gorcunov @ 2012-11-22 21:15 UTC (permalink / raw)
To: Andrew Morton
Cc: Al Viro, Alexey Dobriyan, Pavel Emelyanov, James Bottomley,
Matthew Helsley, aneesh.kumar, bfields, oleg, rientjes,
tvrtko.ursulin, linux-kernel, Cyrill Gorcunov, Andrey Vagin,
Al Viro
[-- Attachment #1: seq-fdinfo-eventpoll-update --]
[-- Type: text/plain, Size: 1586 bytes --]
Once EPOLL_CTL_DISABLE get merged into mainline I'll bring
"enabled" field back. Plain check for rdllink is not enough
here and should be extended, thus to not confuse the readers
drop it for a while.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Pavel Emelyanov <xemul@parallels.com>
CC: Oleg Nesterov <oleg@redhat.com>
CC: Andrey Vagin <avagin@openvz.org>
CC: Al Viro <viro@ZenIV.linux.org.uk>
CC: Alexey Dobriyan <adobriyan@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: James Bottomley <jbottomley@parallels.com>
CC: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
CC: Alexey Dobriyan <adobriyan@gmail.com>
CC: Matthew Helsley <matt.helsley@gmail.com>
CC: "J. Bruce Fields" <bfields@fieldses.org>
CC: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
CC: Tvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
---
fs/eventpoll.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Index: linux-2.6.git/fs/eventpoll.c
===================================================================
--- linux-2.6.git.orig/fs/eventpoll.c
+++ linux-2.6.git/fs/eventpoll.c
@@ -796,10 +796,9 @@ static int ep_show_fdinfo(struct seq_fil
for (rbp = rb_first(&ep->rbr); rbp; rbp = rb_next(rbp)) {
struct epitem *epi = rb_entry(rbp, struct epitem, rbn);
- ret = seq_printf(m, "tfd: %8d events: %8x data: %16llx enabled: %d\n",
+ ret = seq_printf(m, "tfd: %8d events: %8x data: %16llx\n",
epi->ffd.fd, epi->event.events,
- (long long)epi->event.data,
- ep_is_linked(&epi->rdllink));
+ (long long)epi->event.data);
if (ret)
break;
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* [patch -mm 3/4] fs, notify: Dont forget to provide fhandle for inode fanotify
2012-11-22 21:15 [patch -mm 0/4] Fixes for fdinfo output and docs Cyrill Gorcunov
2012-11-22 21:15 ` [patch -mm 1/4] fs, notify: Add missing space after prefix Cyrill Gorcunov
2012-11-22 21:15 ` [patch -mm 2/4] fs, epoll: Drop enabled field from fdinfo output Cyrill Gorcunov
@ 2012-11-22 21:15 ` Cyrill Gorcunov
2012-11-22 21:15 ` [patch -mm 4/4] docs: Add documentation about /proc/<pid>/fdinfo/<fd> output Cyrill Gorcunov
3 siblings, 0 replies; 7+ messages in thread
From: Cyrill Gorcunov @ 2012-11-22 21:15 UTC (permalink / raw)
To: Andrew Morton
Cc: Al Viro, Alexey Dobriyan, Pavel Emelyanov, James Bottomley,
Matthew Helsley, aneesh.kumar, bfields, oleg, rientjes,
tvrtko.ursulin, linux-kernel, Cyrill Gorcunov, Andrey Vagin,
Al Viro
[-- Attachment #1: seq-fsnotify-update --]
[-- Type: text/plain, Size: 2050 bytes --]
For inode based fanotify I missed to add fhandle output. This patch
brings it in.
| pos: 0
| flags: 02
| fanotify ino:2 sdev:800013 mask:1 ignored_mask:40000000 fhandle-bytes:8 fhandle-type:1 f_handle:0200000000000000
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Pavel Emelyanov <xemul@parallels.com>
CC: Oleg Nesterov <oleg@redhat.com>
CC: Andrey Vagin <avagin@openvz.org>
CC: Al Viro <viro@ZenIV.linux.org.uk>
CC: Alexey Dobriyan <adobriyan@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: James Bottomley <jbottomley@parallels.com>
CC: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
CC: Alexey Dobriyan <adobriyan@gmail.com>
CC: Matthew Helsley <matt.helsley@gmail.com>
CC: "J. Bruce Fields" <bfields@fieldses.org>
CC: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
CC: Tvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
---
fs/notify/fdinfo.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
Index: linux-2.6.git/fs/notify/fdinfo.c
===================================================================
--- linux-2.6.git.orig/fs/notify/fdinfo.c
+++ linux-2.6.git/fs/notify/fdinfo.c
@@ -36,8 +36,6 @@ static int show_fdinfo(struct seq_file *
return ret;
}
-#ifdef CONFIG_INOTIFY_USER
-
#if defined(CONFIG_EXPORTFS)
static int show_mark_fhandle(struct seq_file *m, struct inode *inode)
{
@@ -74,6 +72,8 @@ static int show_mark_fhandle(struct seq_
}
#endif
+#ifdef CONFIG_INOTIFY_USER
+
static int inotify_fdinfo(struct seq_file *m, struct fsnotify_mark *mark)
{
struct inotify_inode_mark *inode_mark;
@@ -121,9 +121,11 @@ static int fanotify_fdinfo(struct seq_fi
if (!inode)
goto out;
ret = seq_printf(m, "fanotify ino:%lx sdev:%x "
- "mask:%x ignored_mask:%x\n",
+ "mask:%x ignored_mask:%x ",
inode->i_ino, inode->i_sb->s_dev,
mark->mask, mark->ignored_mask);
+ ret |= show_mark_fhandle(m, inode);
+ ret |= seq_putc(m, '\n');
iput(inode);
} else if (mark->flags & FSNOTIFY_MARK_FLAG_VFSMOUNT) {
struct mount *mnt = real_mount(mark->m.mnt);
^ permalink raw reply [flat|nested] 7+ messages in thread
* [patch -mm 4/4] docs: Add documentation about /proc/<pid>/fdinfo/<fd> output
2012-11-22 21:15 [patch -mm 0/4] Fixes for fdinfo output and docs Cyrill Gorcunov
` (2 preceding siblings ...)
2012-11-22 21:15 ` [patch -mm 3/4] fs, notify: Dont forget to provide fhandle for inode fanotify Cyrill Gorcunov
@ 2012-11-22 21:15 ` Cyrill Gorcunov
2012-11-27 22:47 ` Andrew Morton
3 siblings, 1 reply; 7+ messages in thread
From: Cyrill Gorcunov @ 2012-11-22 21:15 UTC (permalink / raw)
To: Andrew Morton
Cc: Al Viro, Alexey Dobriyan, Pavel Emelyanov, James Bottomley,
Matthew Helsley, aneesh.kumar, bfields, oleg, rientjes,
tvrtko.ursulin, linux-kernel, Cyrill Gorcunov, Andrey Vagin,
Al Viro
[-- Attachment #1: docs-proc-fdinfo --]
[-- Type: text/plain, Size: 4161 bytes --]
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
CC: Pavel Emelyanov <xemul@parallels.com>
CC: Oleg Nesterov <oleg@redhat.com>
CC: Andrey Vagin <avagin@openvz.org>
CC: Al Viro <viro@ZenIV.linux.org.uk>
CC: Alexey Dobriyan <adobriyan@gmail.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: James Bottomley <jbottomley@parallels.com>
CC: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
CC: Alexey Dobriyan <adobriyan@gmail.com>
CC: Matthew Helsley <matt.helsley@gmail.com>
CC: "J. Bruce Fields" <bfields@fieldses.org>
CC: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
CC: Tvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
---
Documentation/filesystems/proc.txt | 81 +++++++++++++++++++++++++++++++++++++
1 file changed, 81 insertions(+)
Index: linux-2.6.git/Documentation/filesystems/proc.txt
===================================================================
--- linux-2.6.git.orig/Documentation/filesystems/proc.txt
+++ linux-2.6.git/Documentation/filesystems/proc.txt
@@ -41,6 +41,7 @@ Table of Contents
3.5 /proc/<pid>/mountinfo - Information about mounts
3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm
3.7 /proc/<pid>/task/<tid>/children - Information about task children
+ 3.8 /proc/<pid>/fdinfo/<fd> - Information about opened file
4 Configuring procfs
4.1 Mount options
@@ -1623,6 +1624,86 @@ pids, so one need to either stop or free
if precise results are needed.
+3.7 /proc/<pid>/fdinfo/<fd> - Information about opened file
+---------------------------------------------------------------
+This file provides information associated with an opened file. The regular
+files have at least two fields -- 'pos' and 'flags'. The 'pos' represents
+the current offset of the opened file in decimal form [see lseek(2) for
+details] and the 'flags' denotes octal O_xxx mask the file has been
+created with [see open(2) for details].
+
+A typical output is
+
+ pos: 0
+ flags: 0100002
+
+The files such as eventfd, fsnotify, signalfd, epoll among the regular pos/flags
+pair provide additional information peculiar to the objects they represent.
+
+ Eventfd files
+ ~~~~~~~~~~~~~
+ pos: 0
+ flags: 04002
+ eventfd-count: 5a
+
+ where 'eventfd-count' is hex value of a counter.
+
+ Signalfd files
+ ~~~~~~~~~~~~~~
+ pos: 0
+ flags: 04002
+ sigmask: 0000000000000200
+
+ where 'sigmask' is hex value of the signal mask associated
+ with a file.
+
+ Epoll files
+ ~~~~~~~~~~~
+ pos: 0
+ flags: 02
+ tfd: 5 events: 1d data: ffffffffffffffff
+
+ where 'tfd' is a target file descriptor number in decimal form,
+ 'events' is events mask being watched and the 'data' is data
+ associated with a target [see epoll(7) for more details].
+
+ Fsnotify files
+ ~~~~~~~~~~~~~~
+ For inotify files the format is the following
+
+ pos: 0
+ flags: 02000000
+ inotify wd:3 ino:9e7e sdev:800013 mask:800afce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:7e9e0000640d1b6d
+
+ where 'wd' is a watch descriptor in decimal form, ie a target file
+ descriptor number, 'ino' and 'sdev' are inode and device where the
+ target file lays on and the 'mask' is the mask of events, all in hex
+ form [see inotify(7) for more details].
+
+ In case if the kernel built with exportfs the path to the target file
+ is encoded as a file handle. The file handle provided by three fields
+ 'fhandle-bytes', 'fhandle-type' and 'f_handle', all in hex format.
+
+ If the kernel is built without exportfs support the file handle won't be
+ printed out.
+
+ For fanotify files the format is the following
+
+ pos: 0
+ flags: 02
+ fanotify ino:2 sdev:800013 mask:1 ignored_mask:40000000 fhandle-bytes:8 fhandle-type:1 f_handle:0200000000000000
+
+ or
+
+ pos: 0
+ flags: 02
+ fanotify mnt_id:13 mask:1 ignored_mask:40000000
+
+ where 'ino', 'sdev' are target inode and device, 'mnt_id' is the mount point identifier,
+ 'mask' is the events mask used and 'ignored_mask' is the mask of events which are
+ to be ignored. All written in hex format.
+
+
------------------------------------------------------------------------------
Configuring procfs
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch -mm 4/4] docs: Add documentation about /proc/<pid>/fdinfo/<fd> output
2012-11-22 21:15 ` [patch -mm 4/4] docs: Add documentation about /proc/<pid>/fdinfo/<fd> output Cyrill Gorcunov
@ 2012-11-27 22:47 ` Andrew Morton
2012-11-28 6:40 ` Cyrill Gorcunov
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2012-11-27 22:47 UTC (permalink / raw)
To: Cyrill Gorcunov
Cc: Al Viro, Alexey Dobriyan, Pavel Emelyanov, James Bottomley,
Matthew Helsley, aneesh.kumar, bfields, oleg, rientjes,
tvrtko.ursulin, linux-kernel, Andrey Vagin
On Fri, 23 Nov 2012 01:15:26 +0400
Cyrill Gorcunov <gorcunov@openvz.org> wrote:
> Documentation/filesystems/proc.txt | 81 +++++++++++++++++++++++++++++++++++++
Looks good to me. Here's a small tune-up:
--- a/Documentation/filesystems/proc.txt~docs-add-documentation-about-proc-pid-fdinfo-fd-output-fix
+++ a/Documentation/filesystems/proc.txt
@@ -1639,7 +1639,7 @@ if precise results are needed.
This file provides information associated with an opened file. The regular
files have at least two fields -- 'pos' and 'flags'. The 'pos' represents
the current offset of the opened file in decimal form [see lseek(2) for
-details] and the 'flags' denotes octal O_xxx mask the file has been
+details] and 'flags' denotes the octal O_xxx mask the file has been
created with [see open(2) for details].
A typical output is
@@ -1648,7 +1648,7 @@ A typical output is
flags: 0100002
The files such as eventfd, fsnotify, signalfd, epoll among the regular pos/flags
-pair provide additional information peculiar to the objects they represent.
+pair provide additional information particular to the objects they represent.
Eventfd files
~~~~~~~~~~~~~
@@ -1687,17 +1687,18 @@ pair provide additional information pecu
where 'wd' is a watch descriptor in decimal form, ie a target file
descriptor number, 'ino' and 'sdev' are inode and device where the
- target file lays on and the 'mask' is the mask of events, all in hex
+ target file resides and the 'mask' is the mask of events, all in hex
form [see inotify(7) for more details].
- In case if the kernel built with exportfs the path to the target file
- is encoded as a file handle. The file handle provided by three fields
- 'fhandle-bytes', 'fhandle-type' and 'f_handle', all in hex format.
+ If the kernel was built with exportfs support, the path to the target
+ file is encoded as a file handle. The file handle is provided by three
+ fields 'fhandle-bytes', 'fhandle-type' and 'f_handle', all in hex
+ format.
If the kernel is built without exportfs support the file handle won't be
printed out.
- For fanotify files the format is the following
+ For fanotify files the format is
pos: 0
flags: 02
@@ -1709,9 +1710,9 @@ pair provide additional information pecu
flags: 02
fanotify mnt_id:13 mask:1 ignored_mask:40000000
- where 'ino', 'sdev' are target inode and device, 'mnt_id' is the mount point identifier,
- 'mask' is the events mask used and 'ignored_mask' is the mask of events which are
- to be ignored. All written in hex format.
+ where 'ino', 'sdev' are target inode and device, 'mnt_id' is the mount
+ point identifier, 'mask' is the events mask used and 'ignored_mask' is
+ the mask of events which are to be ignored. All in hex format.
------------------------------------------------------------------------------
_
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch -mm 4/4] docs: Add documentation about /proc/<pid>/fdinfo/<fd> output
2012-11-27 22:47 ` Andrew Morton
@ 2012-11-28 6:40 ` Cyrill Gorcunov
0 siblings, 0 replies; 7+ messages in thread
From: Cyrill Gorcunov @ 2012-11-28 6:40 UTC (permalink / raw)
To: Andrew Morton
Cc: Al Viro, Alexey Dobriyan, Pavel Emelyanov, James Bottomley,
Matthew Helsley, aneesh.kumar, bfields, oleg, rientjes,
tvrtko.ursulin, linux-kernel, Andrey Vagin
On Tue, Nov 27, 2012 at 02:47:54PM -0800, Andrew Morton wrote:
> On Fri, 23 Nov 2012 01:15:26 +0400
> Cyrill Gorcunov <gorcunov@openvz.org> wrote:
>
> > Documentation/filesystems/proc.txt | 81 +++++++++++++++++++++++++++++++++++++
>
> Looks good to me. Here's a small tune-up:
Thanks a lot, Andrew!
Cyrill
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-11-28 6:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-22 21:15 [patch -mm 0/4] Fixes for fdinfo output and docs Cyrill Gorcunov
2012-11-22 21:15 ` [patch -mm 1/4] fs, notify: Add missing space after prefix Cyrill Gorcunov
2012-11-22 21:15 ` [patch -mm 2/4] fs, epoll: Drop enabled field from fdinfo output Cyrill Gorcunov
2012-11-22 21:15 ` [patch -mm 3/4] fs, notify: Dont forget to provide fhandle for inode fanotify Cyrill Gorcunov
2012-11-22 21:15 ` [patch -mm 4/4] docs: Add documentation about /proc/<pid>/fdinfo/<fd> output Cyrill Gorcunov
2012-11-27 22:47 ` Andrew Morton
2012-11-28 6:40 ` Cyrill Gorcunov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox