[patch -mm 3/4] fs, notify: Dont forget to provide fhandle for inode fanotify

From: Cyrill Gorcunov
Date: Thu Nov 22 2012 - 16:23:04 EST


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@xxxxxxxxxx>
CC: Pavel Emelyanov <xemul@xxxxxxxxxxxxx>
CC: Oleg Nesterov <oleg@xxxxxxxxxx>
CC: Andrey Vagin <avagin@xxxxxxxxxx>
CC: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
CC: Alexey Dobriyan <adobriyan@xxxxxxxxx>
CC: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
CC: James Bottomley <jbottomley@xxxxxxxxxxxxx>
CC: "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxxxxxxx>
CC: Alexey Dobriyan <adobriyan@xxxxxxxxx>
CC: Matthew Helsley <matt.helsley@xxxxxxxxx>
CC: "J. Bruce Fields" <bfields@xxxxxxxxxxxx>
CC: "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxxxxxxx>
CC: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxxxxx>
---
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);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/