Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/viro/vfs

Pull vfs fixes from Al Viro:
 "A couple of fixes; a leak in mntns_install() caught by Andrei (this
  cycle regression) + d_invalidate() softlockup fix - that had been
  reported by a bunch of people lately, but the problem is pretty old"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  fs: don't forget to put old mntns in mntns_install
  Hang/soft lockup in d_invalidate with simultaneous calls
  • Loading branch information
torvalds committed Jun 17, 2017
2 parents 1439ccf + 4068367 commit ccd3d90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 4 additions & 6 deletions fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,7 @@ static void check_and_drop(void *_data)
{
struct detach_data *data = _data;

if (!data->mountpoint && !data->select.found)
if (!data->mountpoint && list_empty(&data->select.dispose))
__d_drop(data->select.start);
}

Expand Down Expand Up @@ -1536,17 +1536,15 @@ void d_invalidate(struct dentry *dentry)

d_walk(dentry, &data, detach_and_collect, check_and_drop);

if (data.select.found)
if (!list_empty(&data.select.dispose))
shrink_dentry_list(&data.select.dispose);
else if (!data.mountpoint)
return;

if (data.mountpoint) {
detach_mounts(data.mountpoint);
dput(data.mountpoint);
}

if (!data.mountpoint && !data.select.found)
break;

cond_resched();
}
}
Expand Down
2 changes: 2 additions & 0 deletions fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -3488,6 +3488,8 @@ static int mntns_install(struct nsproxy *nsproxy, struct ns_common *ns)
return err;
}

put_mnt_ns(old_mnt_ns);

/* Update the pwd and root */
set_fs_pwd(fs, &root);
set_fs_root(fs, &root);
Expand Down

0 comments on commit ccd3d90

Please sign in to comment.