struct fsnotify_group *group;
struct user_struct *user;
struct file *filp;
+ struct path path;
int fd, ret;
/* Check the IN_* constants for consistency. */
atomic_inc(&user->inotify_devs);
- filp = alloc_file(inotify_mnt, dget(inotify_mnt->mnt_root),
- FMODE_READ, &inotify_fops);
+ path.mnt = inotify_mnt;
+ path.dentry = inotify_mnt->mnt_root;
+ path_get(&path);
+ filp = alloc_file(&path, FMODE_READ, &inotify_fops);
if (!filp)
goto Enfile;
Enfile:
ret = -ENFILE;
+ path_put(&path);
atomic_dec(&user->inotify_devs);
out_free_uid:
free_uid(user);