Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207676
b: refs/heads/master
c: 0ff21db
h: refs/heads/master
v: v3
  • Loading branch information
Eric Paris committed Jul 28, 2010
1 parent 0182605 commit ca9aa69
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 90dd201d1ab064512078a77762a793e0bf5f3040
refs/heads/master: 0ff21db9fcc39042b814dad8a4b7508710a75235
15 changes: 11 additions & 4 deletions trunk/fs/notify/fanotify/fanotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ SYSCALL_DEFINE(fanotify_mark)(int fanotify_fd, unsigned int flags,
__u64 mask, int dfd,
const char __user * pathname)
{
struct inode *inode;
struct inode *inode = NULL;
struct vfsmount *mnt = NULL;
struct fsnotify_group *group;
struct file *filp;
struct path path;
Expand Down Expand Up @@ -515,16 +516,22 @@ SYSCALL_DEFINE(fanotify_mark)(int fanotify_fd, unsigned int flags,
goto fput_and_out;

/* inode held in place by reference to path; group by fget on fd */
inode = path.dentry->d_inode;
if (!(flags & FAN_MARK_ON_VFSMOUNT))
inode = path.dentry->d_inode;
else
mnt = path.mnt;
group = filp->private_data;

/* create/update an inode mark */
switch (flags & (FAN_MARK_ADD | FAN_MARK_REMOVE)) {
case FAN_MARK_ADD:
ret = fanotify_add_inode_mark(group, inode, mask);
if (flags & FAN_MARK_ON_VFSMOUNT)
ret = fanotify_add_vfsmount_mark(group, mnt, mask);
else
ret = fanotify_add_inode_mark(group, inode, mask);
break;
case FAN_MARK_REMOVE:
ret = fanotify_remove_mark(group, inode, NULL, mask);
ret = fanotify_remove_mark(group, inode, mnt, mask);
break;
default:
ret = -EINVAL;
Expand Down
4 changes: 3 additions & 1 deletion trunk/include/linux/fanotify.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@
#define FAN_MARK_REMOVE 0x00000002
#define FAN_MARK_DONT_FOLLOW 0x00000004
#define FAN_MARK_ONLYDIR 0x00000008
#define FAN_MARK_ON_VFSMOUNT 0x00000010

#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\
FAN_MARK_REMOVE |\
FAN_MARK_DONT_FOLLOW |\
FAN_MARK_ONLYDIR)
FAN_MARK_ONLYDIR |\
FAN_MARK_ON_VFSMOUNT)

/*
* All of the events - we build the list by hand so that we can add flags in
Expand Down

0 comments on commit ca9aa69

Please sign in to comment.