* [patch 0/2] An update to fanotify fdinfo output
@ 2012-12-07 20:52 Cyrill Gorcunov
2012-12-07 20:53 ` [patch 1/2] [PATCH -mm] fs, fanotify: Add @mflags field to fanotify output Cyrill Gorcunov
2012-12-07 20:53 ` [patch 2/2] [PATCH -mm] docs: Update documentation about /proc/<pid>/fdinfo/<fd> " Cyrill Gorcunov
0 siblings, 2 replies; 3+ messages in thread
From: Cyrill Gorcunov @ 2012-12-07 20:52 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
Hi Andrew, here is an update for fanotify fdinfo output.
I also update documentation to fit the current state of
the output format. This should be the last bits we need
for fdinfo. As always any comments are highly appreciated.
Cyrill
^ permalink raw reply [flat|nested] 3+ messages in thread
* [patch 1/2] [PATCH -mm] fs, fanotify: Add @mflags field to fanotify output
2012-12-07 20:52 [patch 0/2] An update to fanotify fdinfo output Cyrill Gorcunov
@ 2012-12-07 20:53 ` Cyrill Gorcunov
2012-12-07 20:53 ` [patch 2/2] [PATCH -mm] docs: Update documentation about /proc/<pid>/fdinfo/<fd> " Cyrill Gorcunov
1 sibling, 0 replies; 3+ messages in thread
From: Cyrill Gorcunov @ 2012-12-07 20:53 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, Cyrill Gorcunov, Pavel Emelyanov, Oleg Nesterov,
Andrey Vagin, Al Viro, Alexey Dobriyan, James Bottomley,
Aneesh Kumar K.V, Matthew Helsley, J. Bruce Fields,
Tvrtko Ursulin
[-- Attachment #1: fdinfo-fanotify-extend-2 --]
[-- Type: text/plain, Size: 2557 bytes --]
The kernel keeps FAN_MARK_IGNORED_SURV_MODIFY bit separately from
fsnotify_mark::mask|ignored_mask thus put it in @mflags (mark flags)
field so the user-space reader will be able to detect if such bit
were used on mark creation procedure.
| pos: 0
| flags: 04002
| fanotify flags:10 event-flags:0
| fanotify mnt_id:12 mflags:40 mask:38 ignored_mask:40000003
| fanotify ino:4f969 sdev:800013 mflags:0 mask:3b ignored_mask:40000000 fhandle-bytes:8 fhandle-type:1 f_handle:69f90400c275b5b4
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: Matthew Helsley <matt.helsley@gmail.com>
CC: "J. Bruce Fields" <bfields@fieldses.org>
CC: Tvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
---
fs/notify/fdinfo.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 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
@@ -111,29 +111,33 @@ int inotify_show_fdinfo(struct seq_file
static int fanotify_fdinfo(struct seq_file *m, struct fsnotify_mark *mark)
{
+ unsigned int mflags = 0;
struct inode *inode;
int ret = 0;
if (!(mark->flags & FSNOTIFY_MARK_FLAG_ALIVE))
return 0;
+ if (mark->flags & FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY)
+ mflags |= FAN_MARK_IGNORED_SURV_MODIFY;
+
if (mark->flags & FSNOTIFY_MARK_FLAG_INODE) {
inode = igrab(mark->i.inode);
if (!inode)
goto out;
ret = seq_printf(m, "fanotify ino:%lx sdev:%x "
- "mask:%x ignored_mask:%x ",
+ "mflags:%x mask:%x ignored_mask:%x ",
inode->i_ino, inode->i_sb->s_dev,
- mark->mask, mark->ignored_mask);
+ mflags, 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);
- ret = seq_printf(m, "fanotify mnt_id:%x mask:%x "
- "ignored_mask:%x\n",
- mnt->mnt_id, mark->mask, mark->ignored_mask);
+ ret = seq_printf(m, "fanotify mnt_id:%x mflags:%x mask:%x "
+ "ignored_mask:%x\n", mnt->mnt_id, mflags,
+ mark->mask, mark->ignored_mask);
}
out:
return ret;
^ permalink raw reply [flat|nested] 3+ messages in thread
* [patch 2/2] [PATCH -mm] docs: Update documentation about /proc/<pid>/fdinfo/<fd> fanotify output
2012-12-07 20:52 [patch 0/2] An update to fanotify fdinfo output Cyrill Gorcunov
2012-12-07 20:53 ` [patch 1/2] [PATCH -mm] fs, fanotify: Add @mflags field to fanotify output Cyrill Gorcunov
@ 2012-12-07 20:53 ` Cyrill Gorcunov
1 sibling, 0 replies; 3+ messages in thread
From: Cyrill Gorcunov @ 2012-12-07 20:53 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, Cyrill Gorcunov, Pavel Emelyanov, Oleg Nesterov,
Andrey Vagin, Al Viro, Alexey Dobriyan, James Bottomley,
Aneesh Kumar K.V, Matthew Helsley, J. Bruce Fields,
Tvrtko Ursulin
[-- Attachment #1: docs-update-fainfo --]
[-- Type: text/plain, Size: 2727 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 | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
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
@@ -1696,21 +1696,27 @@ pair provide additional information part
If the kernel is built without exportfs support the file handle won't be
printed out.
- For fanotify files the format is
+ If there is no inotify mark attached yet the 'inotify' line will be omitted.
- pos: 0
- flags: 02
- fanotify ino:2 sdev:800013 mask:1 ignored_mask:40000000 fhandle-bytes:8 fhandle-type:1 f_handle:0200000000000000
-
- or
+ For fanotify files the format is
pos: 0
flags: 02
- fanotify mnt_id:13 mask:1 ignored_mask:40000000
+ fanotify flags:10 event-flags:0
+ fanotify mnt_id:12 mflags:40 mask:38 ignored_mask:40000003
+ fanotify ino:4f969 sdev:800013 mflags:0 mask:3b ignored_mask:40000000 fhandle-bytes:8 fhandle-type:1 f_handle:69f90400c275b5b4
+
+ where fanotify 'flags' and 'event-flags' are values used in fanotify_init
+ call, 'mnt_id' is the mount point identifier, 'mflags' is the value of
+ flags associated with mark which are tracked separately from events
+ mask. 'ino', 'sdev' are target inode and device, 'mask' is the events
+ mask and 'ignored_mask' is the mask of events which are to be ignored.
+ All in hex format. Incorporation of 'mflags', 'mask' and 'ignored_mask'
+ does provide information about flags and mask used in fanotify_mark
+ call [see fsnotify manpage for details].
- 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.
+ While the first three lines are mandatory and always printed, the rest is
+ optional and may be omitted if no marks created yet.
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-12-07 20:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-07 20:52 [patch 0/2] An update to fanotify fdinfo output Cyrill Gorcunov
2012-12-07 20:53 ` [patch 1/2] [PATCH -mm] fs, fanotify: Add @mflags field to fanotify output Cyrill Gorcunov
2012-12-07 20:53 ` [patch 2/2] [PATCH -mm] docs: Update documentation about /proc/<pid>/fdinfo/<fd> " Cyrill Gorcunov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox