Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f539abec authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  fs: call security_d_instantiate in d_obtain_alias V2
  lose 'mounting_here' argument in ->d_manage()
  don't pass 'mounting_here' flag to follow_down()
  change the locking order for namespace_sem
  fix deadlock in pivot_root()
  vfs: split off vfsmount-related parts of vfs_kern_mount()
  Some fixes for pstore
  kill simple_set_mnt()
parents 3f6f7e6d 24ff6663
Loading
Loading
Loading
Loading
+1 −5
Original line number Original line Diff line number Diff line
@@ -873,7 +873,7 @@ struct dentry_operations {
	void (*d_iput)(struct dentry *, struct inode *);
	void (*d_iput)(struct dentry *, struct inode *);
	char *(*d_dname)(struct dentry *, char *, int);
	char *(*d_dname)(struct dentry *, char *, int);
	struct vfsmount *(*d_automount)(struct path *);
	struct vfsmount *(*d_automount)(struct path *);
	int (*d_manage)(struct dentry *, bool, bool);
	int (*d_manage)(struct dentry *, bool);
};
};


  d_revalidate: called when the VFS needs to revalidate a dentry. This
  d_revalidate: called when the VFS needs to revalidate a dentry. This
@@ -969,10 +969,6 @@ struct dentry_operations {
	mounted on it and not to check the automount flag.  Any other error
	mounted on it and not to check the automount flag.  Any other error
	code will abort pathwalk completely.
	code will abort pathwalk completely.


	If the 'mounting_here' parameter is true, then namespace_sem is being
	held by the caller and the function should not initiate any mounts or
	unmounts that it will then wait for.

	If the 'rcu_walk' parameter is true, then the caller is doing a
	If the 'rcu_walk' parameter is true, then the caller is doing a
	pathwalk in RCU-walk mode.  Sleeping is not permitted in this mode,
	pathwalk in RCU-walk mode.  Sleeping is not permitted in this mode,
	and the caller can be asked to leave it and call again by returing
	and the caller can be asked to leave it and call again by returing
+3 −3
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@ static long autofs4_root_compat_ioctl(struct file *,unsigned int,unsigned long);
static int autofs4_dir_open(struct inode *inode, struct file *file);
static int autofs4_dir_open(struct inode *inode, struct file *file);
static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *);
static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *);
static struct vfsmount *autofs4_d_automount(struct path *);
static struct vfsmount *autofs4_d_automount(struct path *);
static int autofs4_d_manage(struct dentry *, bool, bool);
static int autofs4_d_manage(struct dentry *, bool);
static void autofs4_dentry_release(struct dentry *);
static void autofs4_dentry_release(struct dentry *);


const struct file_operations autofs4_root_operations = {
const struct file_operations autofs4_root_operations = {
@@ -446,7 +446,7 @@ static struct vfsmount *autofs4_d_automount(struct path *path)
	return NULL;
	return NULL;
}
}


int autofs4_d_manage(struct dentry *dentry, bool mounting_here, bool rcu_walk)
int autofs4_d_manage(struct dentry *dentry, bool rcu_walk)
{
{
	struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
	struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);


@@ -454,7 +454,7 @@ int autofs4_d_manage(struct dentry *dentry, bool mounting_here, bool rcu_walk)
		dentry, dentry->d_name.len, dentry->d_name.name);
		dentry, dentry->d_name.len, dentry->d_name.name);


	/* The daemon never waits. */
	/* The daemon never waits. */
	if (autofs4_oz_mode(sbi) || mounting_here) {
	if (autofs4_oz_mode(sbi)) {
		if (!d_mountpoint(dentry))
		if (!d_mountpoint(dentry))
			return -EISDIR;
			return -EISDIR;
		return 0;
		return 0;
+3 −0
Original line number Original line Diff line number Diff line
@@ -1612,10 +1612,13 @@ struct dentry *d_obtain_alias(struct inode *inode)
	__bit_spin_unlock(0, (unsigned long *)&tmp->d_sb->s_anon.first);
	__bit_spin_unlock(0, (unsigned long *)&tmp->d_sb->s_anon.first);
	spin_unlock(&tmp->d_lock);
	spin_unlock(&tmp->d_lock);
	spin_unlock(&inode->i_lock);
	spin_unlock(&inode->i_lock);
	security_d_instantiate(tmp, inode);


	return tmp;
	return tmp;


 out_iput:
 out_iput:
	if (res && !IS_ERR(res))
		security_d_instantiate(res, inode);
	iput(inode);
	iput(inode);
	return res;
	return res;
}
}
+3 −2
Original line number Original line Diff line number Diff line
@@ -12,6 +12,7 @@
#include <linux/lglock.h>
#include <linux/lglock.h>


struct super_block;
struct super_block;
struct file_system_type;
struct linux_binprm;
struct linux_binprm;
struct path;
struct path;


@@ -61,8 +62,6 @@ extern int check_unsafe_exec(struct linux_binprm *);
extern int copy_mount_options(const void __user *, unsigned long *);
extern int copy_mount_options(const void __user *, unsigned long *);
extern int copy_mount_string(const void __user *, char **);
extern int copy_mount_string(const void __user *, char **);


extern void free_vfsmnt(struct vfsmount *);
extern struct vfsmount *alloc_vfsmnt(const char *);
extern unsigned int mnt_get_count(struct vfsmount *mnt);
extern unsigned int mnt_get_count(struct vfsmount *mnt);
extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
@@ -99,6 +98,8 @@ extern struct file *get_empty_filp(void);
extern int do_remount_sb(struct super_block *, int, void *, int);
extern int do_remount_sb(struct super_block *, int, void *, int);
extern void __put_super(struct super_block *sb);
extern void __put_super(struct super_block *sb);
extern void put_super(struct super_block *sb);
extern void put_super(struct super_block *sb);
extern struct dentry *mount_fs(struct file_system_type *,
			       int, const char *, void *);


/*
/*
 * open.c
 * open.c
+4 −5
Original line number Original line Diff line number Diff line
@@ -933,8 +933,7 @@ static int follow_managed(struct path *path, unsigned flags)
		if (managed & DCACHE_MANAGE_TRANSIT) {
		if (managed & DCACHE_MANAGE_TRANSIT) {
			BUG_ON(!path->dentry->d_op);
			BUG_ON(!path->dentry->d_op);
			BUG_ON(!path->dentry->d_op->d_manage);
			BUG_ON(!path->dentry->d_op->d_manage);
			ret = path->dentry->d_op->d_manage(path->dentry,
			ret = path->dentry->d_op->d_manage(path->dentry, false);
							   false, false);
			if (ret < 0)
			if (ret < 0)
				return ret == -EISDIR ? 0 : ret;
				return ret == -EISDIR ? 0 : ret;
		}
		}
@@ -999,7 +998,7 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
		struct vfsmount *mounted;
		struct vfsmount *mounted;
		if (unlikely(path->dentry->d_flags & DCACHE_MANAGE_TRANSIT) &&
		if (unlikely(path->dentry->d_flags & DCACHE_MANAGE_TRANSIT) &&
		    !reverse_transit &&
		    !reverse_transit &&
		    path->dentry->d_op->d_manage(path->dentry, false, true) < 0)
		    path->dentry->d_op->d_manage(path->dentry, true) < 0)
			return false;
			return false;
		mounted = __lookup_mnt(path->mnt, path->dentry, 1);
		mounted = __lookup_mnt(path->mnt, path->dentry, 1);
		if (!mounted)
		if (!mounted)
@@ -1065,7 +1064,7 @@ static int follow_dotdot_rcu(struct nameidata *nd)
 * Care must be taken as namespace_sem may be held (indicated by mounting_here
 * Care must be taken as namespace_sem may be held (indicated by mounting_here
 * being true).
 * being true).
 */
 */
int follow_down(struct path *path, bool mounting_here)
int follow_down(struct path *path)
{
{
	unsigned managed;
	unsigned managed;
	int ret;
	int ret;
@@ -1086,7 +1085,7 @@ int follow_down(struct path *path, bool mounting_here)
			BUG_ON(!path->dentry->d_op);
			BUG_ON(!path->dentry->d_op);
			BUG_ON(!path->dentry->d_op->d_manage);
			BUG_ON(!path->dentry->d_op->d_manage);
			ret = path->dentry->d_op->d_manage(
			ret = path->dentry->d_op->d_manage(
				path->dentry, mounting_here, false);
				path->dentry, false);
			if (ret < 0)
			if (ret < 0)
				return ret == -EISDIR ? 0 : ret;
				return ret == -EISDIR ? 0 : ret;
		}
		}
Loading