Blame patches/autofs4-2.6.28-v5-update-20090903.patch

Packit 8480eb
--- linux-2.6.28.orig/fs/autofs4/autofs_i.h
Packit 8480eb
+++ linux-2.6.28/fs/autofs4/autofs_i.h
Packit 8480eb
@@ -25,8 +25,6 @@
Packit 8480eb
 #define AUTOFS_DEV_IOCTL_IOC_FIRST	(AUTOFS_DEV_IOCTL_VERSION)
Packit 8480eb
 #define AUTOFS_DEV_IOCTL_IOC_COUNT	(AUTOFS_IOC_COUNT - 11)
Packit 8480eb
 
Packit 8480eb
-#define AUTOFS_TYPE_TRIGGER	(AUTOFS_TYPE_DIRECT|AUTOFS_TYPE_OFFSET)
Packit 8480eb
-
Packit 8480eb
 #include <linux/kernel.h>
Packit 8480eb
 #include <linux/slab.h>
Packit 8480eb
 #include <linux/time.h>
Packit 8480eb
@@ -188,6 +186,8 @@ int autofs4_expire_wait(struct dentry *d
Packit 8480eb
 int autofs4_expire_run(struct super_block *, struct vfsmount *,
Packit 8480eb
 			struct autofs_sb_info *,
Packit 8480eb
 			struct autofs_packet_expire __user *);
Packit 8480eb
+int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
Packit 8480eb
+			    struct autofs_sb_info *sbi, int when);
Packit 8480eb
 int autofs4_expire_multi(struct super_block *, struct vfsmount *,
Packit 8480eb
 			struct autofs_sb_info *, int __user *);
Packit 8480eb
 struct dentry *autofs4_expire_direct(struct super_block *sb,
Packit 8480eb
--- linux-2.6.28.orig/fs/autofs4/dev-ioctl.c
Packit 8480eb
+++ linux-2.6.28/fs/autofs4/dev-ioctl.c
Packit 8480eb
@@ -124,7 +124,7 @@ static inline void free_dev_ioctl(struct
Packit 8480eb
 
Packit 8480eb
 /*
Packit 8480eb
  * Check sanity of parameter control fields and if a path is present
Packit 8480eb
- * check that it has a "/" and is terminated.
Packit 8480eb
+ * check that it is terminated and contains at least one "/".
Packit 8480eb
  */
Packit 8480eb
 static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param)
Packit 8480eb
 {
Packit 8480eb
@@ -138,15 +138,16 @@ static int validate_dev_ioctl(int cmd, s
Packit 8480eb
 	}
Packit 8480eb
 
Packit 8480eb
 	if (param->size > sizeof(*param)) {
Packit 8480eb
-		err = check_name(param->path);
Packit 8480eb
+		err = invalid_str(param->path,
Packit 8480eb
+				 (void *) ((size_t) param + param->size));
Packit 8480eb
 		if (err) {
Packit 8480eb
-			AUTOFS_WARN("invalid path supplied for cmd(0x%08x)",
Packit 8480eb
-				    cmd);
Packit 8480eb
+			AUTOFS_WARN(
Packit 8480eb
+			  "path string terminator missing for cmd(0x%08x)",
Packit 8480eb
+			  cmd);
Packit 8480eb
 			goto out;
Packit 8480eb
 		}
Packit 8480eb
 
Packit 8480eb
-		err = invalid_str(param->path,
Packit 8480eb
-				 (void *) ((size_t) param + param->size));
Packit 8480eb
+		err = check_name(param->path);
Packit 8480eb
 		if (err) {
Packit 8480eb
 			AUTOFS_WARN("invalid path supplied for cmd(0x%08x)",
Packit 8480eb
 				    cmd);
Packit 8480eb
@@ -180,7 +181,7 @@ static int autofs_dev_ioctl_protover(str
Packit 8480eb
 				     struct autofs_sb_info *sbi,
Packit 8480eb
 				     struct autofs_dev_ioctl *param)
Packit 8480eb
 {
Packit 8480eb
-	param->arg1 = sbi->version;
Packit 8480eb
+	param->protover.version = sbi->version;
Packit 8480eb
 	return 0;
Packit 8480eb
 }
Packit 8480eb
 
Packit 8480eb
@@ -189,7 +190,7 @@ static int autofs_dev_ioctl_protosubver(
Packit 8480eb
 					struct autofs_sb_info *sbi,
Packit 8480eb
 					struct autofs_dev_ioctl *param)
Packit 8480eb
 {
Packit 8480eb
-	param->arg1 = sbi->sub_version;
Packit 8480eb
+	param->protosubver.sub_version = sbi->sub_version;
Packit 8480eb
 	return 0;
Packit 8480eb
 }
Packit 8480eb
 
Packit 8480eb
@@ -334,13 +335,13 @@ static int autofs_dev_ioctl_openmount(st
Packit 8480eb
 	int err, fd;
Packit 8480eb
 
Packit 8480eb
 	/* param->path has already been checked */
Packit 8480eb
-	if (!param->arg1)
Packit 8480eb
+	if (!param->openmount.devid)
Packit 8480eb
 		return -EINVAL;
Packit 8480eb
 
Packit 8480eb
 	param->ioctlfd = -1;
Packit 8480eb
 
Packit 8480eb
 	path = param->path;
Packit 8480eb
-	devid = param->arg1;
Packit 8480eb
+	devid = param->openmount.devid;
Packit 8480eb
 
Packit 8480eb
 	err = 0;
Packit 8480eb
 	fd = autofs_dev_ioctl_open_mountpoint(path, devid);
Packit 8480eb
@@ -372,7 +373,7 @@ static int autofs_dev_ioctl_ready(struct
Packit 8480eb
 {
Packit 8480eb
 	autofs_wqt_t token;
Packit 8480eb
 
Packit 8480eb
-	token = (autofs_wqt_t) param->arg1;
Packit 8480eb
+	token = (autofs_wqt_t) param->ready.token;
Packit 8480eb
 	return autofs4_wait_release(sbi, token, 0);
Packit 8480eb
 }
Packit 8480eb
 
Packit 8480eb
@@ -387,8 +388,8 @@ static int autofs_dev_ioctl_fail(struct 
Packit 8480eb
 	autofs_wqt_t token;
Packit 8480eb
 	int status;
Packit 8480eb
 
Packit 8480eb
-	token = (autofs_wqt_t) param->arg1;
Packit 8480eb
-	status = param->arg2 ? param->arg2 : -ENOENT;
Packit 8480eb
+	token = (autofs_wqt_t) param->fail.token;
Packit 8480eb
+	status = param->fail.status ? param->fail.status : -ENOENT;
Packit 8480eb
 	return autofs4_wait_release(sbi, token, status);
Packit 8480eb
 }
Packit 8480eb
 
Packit 8480eb
@@ -411,10 +412,10 @@ static int autofs_dev_ioctl_setpipefd(st
Packit 8480eb
 	int pipefd;
Packit 8480eb
 	int err = 0;
Packit 8480eb
 
Packit 8480eb
-	if (param->arg1 == -1)
Packit 8480eb
+	if (param->setpipefd.pipefd == -1)
Packit 8480eb
 		return -EINVAL;
Packit 8480eb
 
Packit 8480eb
-	pipefd = param->arg1;
Packit 8480eb
+	pipefd = param->setpipefd.pipefd;
Packit 8480eb
 
Packit 8480eb
 	mutex_lock(&sbi->wq_mutex);
Packit 8480eb
 	if (!sbi->catatonic) {
Packit 8480eb
@@ -456,8 +457,8 @@ static int autofs_dev_ioctl_timeout(stru
Packit 8480eb
 {
Packit 8480eb
 	unsigned long timeout;
Packit 8480eb
 
Packit 8480eb
-	timeout = param->arg1;
Packit 8480eb
-	param->arg1 = sbi->exp_timeout / HZ;
Packit 8480eb
+	timeout = param->timeout.timeout;
Packit 8480eb
+	param->timeout.timeout = sbi->exp_timeout / HZ;
Packit 8480eb
 	sbi->exp_timeout = timeout * HZ;
Packit 8480eb
 	return 0;
Packit 8480eb
 }
Packit 8480eb
@@ -488,7 +489,7 @@ static int autofs_dev_ioctl_requester(st
Packit 8480eb
 	path = param->path;
Packit 8480eb
 	devid = sbi->sb->s_dev;
Packit 8480eb
 
Packit 8480eb
-	param->arg1 = param->arg2 = -1;
Packit 8480eb
+	param->requester.uid = param->requester.gid = -1;
Packit 8480eb
 
Packit 8480eb
 	/* Get nameidata of the parent directory */
Packit 8480eb
 	err = path_lookup(path, LOOKUP_PARENT, &nd);
Packit 8480eb
@@ -504,8 +505,8 @@ static int autofs_dev_ioctl_requester(st
Packit 8480eb
 		err = 0;
Packit 8480eb
 		autofs4_expire_wait(nd.path.dentry);
Packit 8480eb
 		spin_lock(&sbi->fs_lock);
Packit 8480eb
-		param->arg1 = ino->uid;
Packit 8480eb
-		param->arg2 = ino->gid;
Packit 8480eb
+		param->requester.uid = ino->uid;
Packit 8480eb
+		param->requester.gid = ino->gid;
Packit 8480eb
 		spin_unlock(&sbi->fs_lock);
Packit 8480eb
 	}
Packit 8480eb
 
Packit 8480eb
@@ -523,40 +524,13 @@ static int autofs_dev_ioctl_expire(struc
Packit 8480eb
 				   struct autofs_sb_info *sbi,
Packit 8480eb
 				   struct autofs_dev_ioctl *param)
Packit 8480eb
 {
Packit 8480eb
-	struct dentry *dentry;
Packit 8480eb
 	struct vfsmount *mnt;
Packit 8480eb
-	int err = -EAGAIN;
Packit 8480eb
 	int how;
Packit 8480eb
 
Packit 8480eb
-	how = param->arg1;
Packit 8480eb
+	how = param->expire.how;
Packit 8480eb
 	mnt = fp->f_path.mnt;
Packit 8480eb
 
Packit 8480eb
-	if (sbi->type & AUTOFS_TYPE_TRIGGER)
Packit 8480eb
-		dentry = autofs4_expire_direct(sbi->sb, mnt, sbi, how);
Packit 8480eb
-	else
Packit 8480eb
-		dentry = autofs4_expire_indirect(sbi->sb, mnt, sbi, how);
Packit 8480eb
-
Packit 8480eb
-	if (dentry) {
Packit 8480eb
-		struct autofs_info *ino = autofs4_dentry_ino(dentry);
Packit 8480eb
-
Packit 8480eb
-		/*
Packit 8480eb
-		 * This is synchronous because it makes the daemon a
Packit 8480eb
-		 * little easier
Packit 8480eb
-		*/
Packit 8480eb
-		err = autofs4_wait(sbi, dentry, NFY_EXPIRE);
Packit 8480eb
-
Packit 8480eb
-		spin_lock(&sbi->fs_lock);
Packit 8480eb
-		if (ino->flags & AUTOFS_INF_MOUNTPOINT) {
Packit 8480eb
-			ino->flags &= ~AUTOFS_INF_MOUNTPOINT;
Packit 8480eb
-			sbi->sb->s_root->d_mounted++;
Packit 8480eb
-		}
Packit 8480eb
-		ino->flags &= ~AUTOFS_INF_EXPIRING;
Packit 8480eb
-		complete_all(&ino->expire_complete);
Packit 8480eb
-		spin_unlock(&sbi->fs_lock);
Packit 8480eb
-		dput(dentry);
Packit 8480eb
-	}
Packit 8480eb
-
Packit 8480eb
-	return err;
Packit 8480eb
+	return autofs4_do_expire_multi(sbi->sb, mnt, sbi, how);
Packit 8480eb
 }
Packit 8480eb
 
Packit 8480eb
 /* Check if autofs mount point is in use */
Packit 8480eb
@@ -564,9 +538,9 @@ static int autofs_dev_ioctl_askumount(st
Packit 8480eb
 				      struct autofs_sb_info *sbi,
Packit 8480eb
 				      struct autofs_dev_ioctl *param)
Packit 8480eb
 {
Packit 8480eb
-	param->arg1 = 0;
Packit 8480eb
+	param->askumount.may_umount = 0;
Packit 8480eb
 	if (may_umount(fp->f_path.mnt))
Packit 8480eb
-		param->arg1 = 1;
Packit 8480eb
+		param->askumount.may_umount = 1;
Packit 8480eb
 	return 0;
Packit 8480eb
 }
Packit 8480eb
 
Packit 8480eb
@@ -599,6 +573,7 @@ static int autofs_dev_ioctl_ismountpoint
Packit 8480eb
 	struct nameidata nd;
Packit 8480eb
 	const char *path;
Packit 8480eb
 	unsigned int type;
Packit 8480eb
+	unsigned int devid, magic;
Packit 8480eb
 	int err = -ENOENT;
Packit 8480eb
 
Packit 8480eb
 	if (param->size <= sizeof(*param)) {
Packit 8480eb
@@ -607,13 +582,13 @@ static int autofs_dev_ioctl_ismountpoint
Packit 8480eb
 	}
Packit 8480eb
 
Packit 8480eb
 	path = param->path;
Packit 8480eb
-	type = param->arg1;
Packit 8480eb
+	type = param->ismountpoint.in.type;
Packit 8480eb
 
Packit 8480eb
-	param->arg1 = 0;
Packit 8480eb
-	param->arg2 = 0;
Packit 8480eb
+	param->ismountpoint.out.devid = devid = 0;
Packit 8480eb
+	param->ismountpoint.out.magic = magic = 0;
Packit 8480eb
 
Packit 8480eb
 	if (!fp || param->ioctlfd == -1) {
Packit 8480eb
-		if (type == AUTOFS_TYPE_ANY) {
Packit 8480eb
+		if (autofs_type_any(type)) {
Packit 8480eb
 			struct super_block *sb;
Packit 8480eb
 
Packit 8480eb
 			err = path_lookup(path, LOOKUP_FOLLOW, &nd);
Packit 8480eb
@@ -621,7 +596,7 @@ static int autofs_dev_ioctl_ismountpoint
Packit 8480eb
 				goto out;
Packit 8480eb
 
Packit 8480eb
 			sb = nd.path.dentry->d_sb;
Packit 8480eb
-			param->arg1 = new_encode_dev(sb->s_dev);
Packit 8480eb
+			devid = new_encode_dev(sb->s_dev);
Packit 8480eb
 		} else {
Packit 8480eb
 			struct autofs_info *ino;
Packit 8480eb
 
Packit 8480eb
@@ -634,38 +609,41 @@ static int autofs_dev_ioctl_ismountpoint
Packit 8480eb
 				goto out_release;
Packit 8480eb
 
Packit 8480eb
 			ino = autofs4_dentry_ino(nd.path.dentry);
Packit 8480eb
-			param->arg1 = autofs4_get_dev(ino->sbi);
Packit 8480eb
+			devid = autofs4_get_dev(ino->sbi);
Packit 8480eb
 		}
Packit 8480eb
 
Packit 8480eb
 		err = 0;
Packit 8480eb
 		if (nd.path.dentry->d_inode &&
Packit 8480eb
 		    nd.path.mnt->mnt_root == nd.path.dentry) {
Packit 8480eb
 			err = 1;
Packit 8480eb
-			param->arg2 = nd.path.dentry->d_inode->i_sb->s_magic;
Packit 8480eb
+			magic = nd.path.dentry->d_inode->i_sb->s_magic;
Packit 8480eb
 		}
Packit 8480eb
 	} else {
Packit 8480eb
-		dev_t devid = new_encode_dev(sbi->sb->s_dev);
Packit 8480eb
+		dev_t dev = autofs4_get_dev(sbi);
Packit 8480eb
 
Packit 8480eb
 		err = path_lookup(path, LOOKUP_PARENT, &nd);
Packit 8480eb
 		if (err)
Packit 8480eb
 			goto out;
Packit 8480eb
 
Packit 8480eb
-		err = autofs_dev_ioctl_find_super(&nd, devid);
Packit 8480eb
+		err = autofs_dev_ioctl_find_super(&nd, dev);
Packit 8480eb
 		if (err)
Packit 8480eb
 			goto out_release;
Packit 8480eb
 
Packit 8480eb
-		param->arg1 = autofs4_get_dev(sbi);
Packit 8480eb
+		devid = dev;
Packit 8480eb
 
Packit 8480eb
 		err = have_submounts(nd.path.dentry);
Packit 8480eb
 
Packit 8480eb
 		if (nd.path.mnt->mnt_mountpoint != nd.path.mnt->mnt_root) {
Packit 8480eb
 			if (follow_down(&nd.path.mnt, &nd.path.dentry)) {
Packit 8480eb
 				struct inode *inode = nd.path.dentry->d_inode;
Packit 8480eb
-				param->arg2 = inode->i_sb->s_magic;
Packit 8480eb
+				magic = inode->i_sb->s_magic;
Packit 8480eb
 			}
Packit 8480eb
 		}
Packit 8480eb
 	}
Packit 8480eb
 
Packit 8480eb
+	param->ismountpoint.out.devid = devid;
Packit 8480eb
+	param->ismountpoint.out.magic = magic;
Packit 8480eb
+
Packit 8480eb
 out_release:
Packit 8480eb
 	path_put(&nd.path);
Packit 8480eb
 out:
Packit 8480eb
--- linux-2.6.28.orig/fs/autofs4/expire.c
Packit 8480eb
+++ linux-2.6.28/fs/autofs4/expire.c
Packit 8480eb
@@ -63,15 +63,17 @@ static int autofs4_mount_busy(struct vfs
Packit 8480eb
 		struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
Packit 8480eb
 
Packit 8480eb
 		/* This is an autofs submount, we can't expire it */
Packit 8480eb
-		if (sbi->type == AUTOFS_TYPE_INDIRECT)
Packit 8480eb
+		if (autofs_type_indirect(sbi->type))
Packit 8480eb
 			goto done;
Packit 8480eb
 
Packit 8480eb
 		/*
Packit 8480eb
 		 * Otherwise it's an offset mount and we need to check
Packit 8480eb
 		 * if we can umount its mount, if there is one.
Packit 8480eb
 		 */
Packit 8480eb
-		if (!d_mountpoint(dentry))
Packit 8480eb
+		if (!d_mountpoint(dentry)) {
Packit 8480eb
+			status = 0;
Packit 8480eb
 			goto done;
Packit 8480eb
+		}
Packit 8480eb
 	}
Packit 8480eb
 
Packit 8480eb
 	/* Update the expiry counter if fs is busy */
Packit 8480eb
@@ -478,22 +480,16 @@ int autofs4_expire_run(struct super_bloc
Packit 8480eb
 	return ret;
Packit 8480eb
 }
Packit 8480eb
 
Packit 8480eb
-/* Call repeatedly until it returns -EAGAIN, meaning there's nothing
Packit 8480eb
-   more to be done */
Packit 8480eb
-int autofs4_expire_multi(struct super_block *sb, struct vfsmount *mnt,
Packit 8480eb
-			struct autofs_sb_info *sbi, int __user *arg)
Packit 8480eb
+int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt,
Packit 8480eb
+			    struct autofs_sb_info *sbi, int when)
Packit 8480eb
 {
Packit 8480eb
 	struct dentry *dentry;
Packit 8480eb
 	int ret = -EAGAIN;
Packit 8480eb
-	int do_now = 0;
Packit 8480eb
 
Packit 8480eb
-	if (arg && get_user(do_now, arg))
Packit 8480eb
-		return -EFAULT;
Packit 8480eb
-
Packit 8480eb
-	if (sbi->type & AUTOFS_TYPE_TRIGGER)
Packit 8480eb
-		dentry = autofs4_expire_direct(sb, mnt, sbi, do_now);
Packit 8480eb
+	if (autofs_type_trigger(sbi->type))
Packit 8480eb
+		dentry = autofs4_expire_direct(sb, mnt, sbi, when);
Packit 8480eb
 	else
Packit 8480eb
-		dentry = autofs4_expire_indirect(sb, mnt, sbi, do_now);
Packit 8480eb
+		dentry = autofs4_expire_indirect(sb, mnt, sbi, when);
Packit 8480eb
 
Packit 8480eb
 	if (dentry) {
Packit 8480eb
 		struct autofs_info *ino = autofs4_dentry_ino(dentry);
Packit 8480eb
@@ -516,3 +512,16 @@ int autofs4_expire_multi(struct super_bl
Packit 8480eb
 	return ret;
Packit 8480eb
 }
Packit 8480eb
 
Packit 8480eb
+/* Call repeatedly until it returns -EAGAIN, meaning there's nothing
Packit 8480eb
+   more to be done */
Packit 8480eb
+int autofs4_expire_multi(struct super_block *sb, struct vfsmount *mnt,
Packit 8480eb
+			struct autofs_sb_info *sbi, int __user *arg)
Packit 8480eb
+{
Packit 8480eb
+	int do_now = 0;
Packit 8480eb
+
Packit 8480eb
+	if (arg && get_user(do_now, arg))
Packit 8480eb
+		return -EFAULT;
Packit 8480eb
+
Packit 8480eb
+	return autofs4_do_expire_multi(sb, mnt, sbi, do_now);
Packit 8480eb
+}
Packit 8480eb
+
Packit 8480eb
--- linux-2.6.28.orig/fs/autofs4/inode.c
Packit 8480eb
+++ linux-2.6.28/fs/autofs4/inode.c
Packit 8480eb
@@ -197,9 +197,9 @@ static int autofs4_show_options(struct s
Packit 8480eb
 	seq_printf(m, ",minproto=%d", sbi->min_proto);
Packit 8480eb
 	seq_printf(m, ",maxproto=%d", sbi->max_proto);
Packit 8480eb
 
Packit 8480eb
-	if (sbi->type & AUTOFS_TYPE_OFFSET)
Packit 8480eb
+	if (autofs_type_offset(sbi->type))
Packit 8480eb
 		seq_printf(m, ",offset");
Packit 8480eb
-	else if (sbi->type & AUTOFS_TYPE_DIRECT)
Packit 8480eb
+	else if (autofs_type_direct(sbi->type))
Packit 8480eb
 		seq_printf(m, ",direct");
Packit 8480eb
 	else
Packit 8480eb
 		seq_printf(m, ",indirect");
Packit 8480eb
@@ -284,13 +284,13 @@ static int parse_options(char *options, 
Packit 8480eb
 			*maxproto = option;
Packit 8480eb
 			break;
Packit 8480eb
 		case Opt_indirect:
Packit 8480eb
-			*type = AUTOFS_TYPE_INDIRECT;
Packit 8480eb
+			set_autofs_type_indirect(type);
Packit 8480eb
 			break;
Packit 8480eb
 		case Opt_direct:
Packit 8480eb
-			*type = AUTOFS_TYPE_DIRECT;
Packit 8480eb
+			set_autofs_type_direct(type);
Packit 8480eb
 			break;
Packit 8480eb
 		case Opt_offset:
Packit 8480eb
-			*type = AUTOFS_TYPE_OFFSET;
Packit 8480eb
+			set_autofs_type_offset(type);
Packit 8480eb
 			break;
Packit 8480eb
 		default:
Packit 8480eb
 			return 1;
Packit 8480eb
@@ -338,7 +338,7 @@ int autofs4_fill_super(struct super_bloc
Packit 8480eb
 	sbi->sb = s;
Packit 8480eb
 	sbi->version = 0;
Packit 8480eb
 	sbi->sub_version = 0;
Packit 8480eb
-	sbi->type = AUTOFS_TYPE_INDIRECT;
Packit 8480eb
+	set_autofs_type_indirect(&sbi->type);
Packit 8480eb
 	sbi->min_proto = 0;
Packit 8480eb
 	sbi->max_proto = 0;
Packit 8480eb
 	mutex_init(&sbi->wq_mutex);
Packit 8480eb
@@ -380,7 +380,7 @@ int autofs4_fill_super(struct super_bloc
Packit 8480eb
 	}
Packit 8480eb
 
Packit 8480eb
 	root_inode->i_fop = &autofs4_root_operations;
Packit 8480eb
-	root_inode->i_op = sbi->type & AUTOFS_TYPE_TRIGGER ?
Packit 8480eb
+	root_inode->i_op = autofs_type_trigger(sbi->type) ?
Packit 8480eb
 			&autofs4_direct_root_inode_operations :
Packit 8480eb
 			&autofs4_indirect_root_inode_operations;
Packit 8480eb
 
Packit 8480eb
--- linux-2.6.28.orig/fs/autofs4/waitq.c
Packit 8480eb
+++ linux-2.6.28/fs/autofs4/waitq.c
Packit 8480eb
@@ -297,20 +297,14 @@ static int validate_request(struct autof
Packit 8480eb
 	 */
Packit 8480eb
 	if (notify == NFY_MOUNT) {
Packit 8480eb
 		/*
Packit 8480eb
-		 * If the dentry isn't hashed just go ahead and try the
Packit 8480eb
-		 * mount again with a new wait (not much else we can do).
Packit 8480eb
-		*/
Packit 8480eb
-		if (!d_unhashed(dentry)) {
Packit 8480eb
-			/*
Packit 8480eb
-			 * But if the dentry is hashed, that means that we
Packit 8480eb
-			 * got here through the revalidate path.  Thus, we
Packit 8480eb
-			 * need to check if the dentry has been mounted
Packit 8480eb
-			 * while we waited on the wq_mutex. If it has,
Packit 8480eb
-			 * simply return success.
Packit 8480eb
-			 */
Packit 8480eb
-			if (d_mountpoint(dentry))
Packit 8480eb
-				return 0;
Packit 8480eb
-		}
Packit 8480eb
+		 * If the dentry was successfully mounted while we slept
Packit 8480eb
+		 * on the wait queue mutex we can return success. If it
Packit 8480eb
+		 * isn't mounted (doesn't have submounts for the case of
Packit 8480eb
+		 * a multi-mount with no mount at it's base) we can
Packit 8480eb
+		 * continue on and create a new request.
Packit 8480eb
+		 */
Packit 8480eb
+		if (have_submounts(dentry))
Packit 8480eb
+			return 0;
Packit 8480eb
 	}
Packit 8480eb
 
Packit 8480eb
 	return 1;
Packit 8480eb
@@ -337,7 +331,7 @@ int autofs4_wait(struct autofs_sb_info *
Packit 8480eb
 		 * is very similar for indirect mounts except only dentrys
Packit 8480eb
 		 * in the root of the autofs file system may be negative.
Packit 8480eb
 		 */
Packit 8480eb
-		if (sbi->type & AUTOFS_TYPE_TRIGGER)
Packit 8480eb
+		if (autofs_type_trigger(sbi->type))
Packit 8480eb
 			return -ENOENT;
Packit 8480eb
 		else if (!IS_ROOT(dentry->d_parent))
Packit 8480eb
 			return -ENOENT;
Packit 8480eb
@@ -348,7 +342,7 @@ int autofs4_wait(struct autofs_sb_info *
Packit 8480eb
 		return -ENOMEM;
Packit 8480eb
 
Packit 8480eb
 	/* If this is a direct mount request create a dummy name */
Packit 8480eb
-	if (IS_ROOT(dentry) && sbi->type & AUTOFS_TYPE_TRIGGER)
Packit 8480eb
+	if (IS_ROOT(dentry) && autofs_type_trigger(sbi->type))
Packit 8480eb
 		qstr.len = sprintf(name, "%p", dentry);
Packit 8480eb
 	else {
Packit 8480eb
 		qstr.len = autofs4_getpath(sbi, dentry, &name);
Packit 8480eb
@@ -406,11 +400,11 @@ int autofs4_wait(struct autofs_sb_info *
Packit 8480eb
 				type = autofs_ptype_expire_multi;
Packit 8480eb
 		} else {
Packit 8480eb
 			if (notify == NFY_MOUNT)
Packit 8480eb
-				type = (sbi->type & AUTOFS_TYPE_TRIGGER) ?
Packit 8480eb
+				type = autofs_type_trigger(sbi->type) ?
Packit 8480eb
 					autofs_ptype_missing_direct :
Packit 8480eb
 					 autofs_ptype_missing_indirect;
Packit 8480eb
 			else
Packit 8480eb
-				type = (sbi->type & AUTOFS_TYPE_TRIGGER) ?
Packit 8480eb
+				type = autofs_type_trigger(sbi->type) ?
Packit 8480eb
 					autofs_ptype_expire_direct :
Packit 8480eb
 					autofs_ptype_expire_indirect;
Packit 8480eb
 		}
Packit 8480eb
--- linux-2.6.28.orig/include/linux/auto_fs4.h
Packit 8480eb
+++ linux-2.6.28/include/linux/auto_fs4.h
Packit 8480eb
@@ -29,10 +29,64 @@
Packit 8480eb
 #define AUTOFS_EXP_IMMEDIATE		1
Packit 8480eb
 #define AUTOFS_EXP_LEAVES		2
Packit 8480eb
 
Packit 8480eb
-#define AUTOFS_TYPE_ANY			0x0000
Packit 8480eb
-#define AUTOFS_TYPE_INDIRECT		0x0001
Packit 8480eb
-#define AUTOFS_TYPE_DIRECT		0x0002
Packit 8480eb
-#define AUTOFS_TYPE_OFFSET		0x0004
Packit 8480eb
+#define AUTOFS_TYPE_ANY			0U
Packit 8480eb
+#define AUTOFS_TYPE_INDIRECT		1U
Packit 8480eb
+#define AUTOFS_TYPE_DIRECT		2U
Packit 8480eb
+#define AUTOFS_TYPE_OFFSET		4U
Packit 8480eb
+
Packit 8480eb
+static inline void set_autofs_type_indirect(unsigned int *type)
Packit 8480eb
+{
Packit 8480eb
+	*type = AUTOFS_TYPE_INDIRECT;
Packit 8480eb
+	return;
Packit 8480eb
+}
Packit 8480eb
+
Packit 8480eb
+static inline unsigned int autofs_type_indirect(unsigned int type)
Packit 8480eb
+{
Packit 8480eb
+	return (type == AUTOFS_TYPE_INDIRECT);
Packit 8480eb
+}
Packit 8480eb
+
Packit 8480eb
+static inline void set_autofs_type_direct(unsigned int *type)
Packit 8480eb
+{
Packit 8480eb
+	*type = AUTOFS_TYPE_DIRECT;
Packit 8480eb
+	return;
Packit 8480eb
+}
Packit 8480eb
+
Packit 8480eb
+static inline unsigned int autofs_type_direct(unsigned int type)
Packit 8480eb
+{
Packit 8480eb
+	return (type == AUTOFS_TYPE_DIRECT);
Packit 8480eb
+}
Packit 8480eb
+
Packit 8480eb
+static inline void set_autofs_type_offset(unsigned int *type)
Packit 8480eb
+{
Packit 8480eb
+	*type = AUTOFS_TYPE_OFFSET;
Packit 8480eb
+	return;
Packit 8480eb
+}
Packit 8480eb
+
Packit 8480eb
+static inline unsigned int autofs_type_offset(unsigned int type)
Packit 8480eb
+{
Packit 8480eb
+	return (type == AUTOFS_TYPE_OFFSET);
Packit 8480eb
+}
Packit 8480eb
+
Packit 8480eb
+static inline unsigned int autofs_type_trigger(unsigned int type)
Packit 8480eb
+{
Packit 8480eb
+	return (type == AUTOFS_TYPE_DIRECT || type == AUTOFS_TYPE_OFFSET);
Packit 8480eb
+}
Packit 8480eb
+
Packit 8480eb
+/*
Packit 8480eb
+ * This isn't really a type as we use it to say "no type set" to
Packit 8480eb
+ * indicate we want to search for "any" mount in the
Packit 8480eb
+ * autofs_dev_ioctl_ismountpoint() device ioctl function.
Packit 8480eb
+ */
Packit 8480eb
+static inline void set_autofs_type_any(unsigned int *type)
Packit 8480eb
+{
Packit 8480eb
+	*type = AUTOFS_TYPE_ANY;
Packit 8480eb
+	return;
Packit 8480eb
+}
Packit 8480eb
+
Packit 8480eb
+static inline unsigned int autofs_type_any(unsigned int type)
Packit 8480eb
+{
Packit 8480eb
+	return (type == AUTOFS_TYPE_ANY);
Packit 8480eb
+}
Packit 8480eb
 
Packit 8480eb
 /* Daemon notification packet types */
Packit 8480eb
 enum autofs_notify {
Packit 8480eb
--- linux-2.6.28.orig/Documentation/filesystems/autofs4-mount-control.txt
Packit 8480eb
+++ linux-2.6.28/Documentation/filesystems/autofs4-mount-control.txt
Packit 8480eb
@@ -179,8 +179,21 @@ struct autofs_dev_ioctl {
Packit 8480eb
 				 * including this struct */
Packit 8480eb
 	__s32 ioctlfd;          /* automount command fd */
Packit 8480eb
 
Packit 8480eb
-	__u32 arg1;             /* Command parameters */
Packit 8480eb
-	__u32 arg2;
Packit 8480eb
+	/* Command parameters */
Packit 8480eb
+
Packit 8480eb
+	union {
Packit 8480eb
+		struct args_protover            protover;
Packit 8480eb
+		struct args_protosubver         protosubver;
Packit 8480eb
+		struct args_openmount           openmount;
Packit 8480eb
+		struct args_ready               ready;
Packit 8480eb
+		struct args_fail                fail;
Packit 8480eb
+		struct args_setpipefd           setpipefd;
Packit 8480eb
+		struct args_timeout             timeout;
Packit 8480eb
+		struct args_requester           requester;
Packit 8480eb
+		struct args_expire              expire;
Packit 8480eb
+		struct args_askumount           askumount;
Packit 8480eb
+		struct args_ismountpoint        ismountpoint;
Packit 8480eb
+	};
Packit 8480eb
 
Packit 8480eb
 	char path[0];
Packit 8480eb
 };
Packit 8480eb
@@ -192,8 +205,8 @@ optionally be used to check a specific m
Packit 8480eb
 mount point file descriptor, and when requesting the uid and gid of the
Packit 8480eb
 last successful mount on a directory within the autofs file system.
Packit 8480eb
 
Packit 8480eb
-The fields arg1 and arg2 are used to communicate parameters and results of
Packit 8480eb
-calls made as described below.
Packit 8480eb
+The anonymous union is used to communicate parameters and results of calls
Packit 8480eb
+made as described below.
Packit 8480eb
 
Packit 8480eb
 The path field is used to pass a path where it is needed and the size field
Packit 8480eb
 is used account for the increased structure length when translating the
Packit 8480eb
@@ -245,25 +258,27 @@ AUTOFS_DEV_IOCTL_PROTOVER_CMD and AUTOFS
Packit 8480eb
 Get the major and minor version of the autofs4 protocol version understood
Packit 8480eb
 by loaded module. This call requires an initialized struct autofs_dev_ioctl
Packit 8480eb
 with the ioctlfd field set to a valid autofs mount point descriptor
Packit 8480eb
-and sets the requested version number in structure field arg1. These
Packit 8480eb
-commands return 0 on success or one of the negative error codes if
Packit 8480eb
-validation fails.
Packit 8480eb
+and sets the requested version number in structure field protover.version
Packit 8480eb
+and ptotosubver.sub_version respectively. These commands return 0 on
Packit 8480eb
+success or one of the negative error codes if validation fails.
Packit 8480eb
 
Packit 8480eb
 
Packit 8480eb
-AUTOFS_DEV_IOCTL_OPENMOUNT and AUTOFS_DEV_IOCTL_CLOSEMOUNT
Packit 8480eb
-----------------------------------------------------------
Packit 8480eb
+AUTOFS_DEV_IOCTL_OPENMOUNT_CMD and AUTOFS_DEV_IOCTL_CLOSEMOUNT_CMD
Packit 8480eb
+------------------------------------------------------------------
Packit 8480eb
 
Packit 8480eb
 Obtain and release a file descriptor for an autofs managed mount point
Packit 8480eb
 path. The open call requires an initialized struct autofs_dev_ioctl with
Packit 8480eb
 the the path field set and the size field adjusted appropriately as well
Packit 8480eb
-as the arg1 field set to the device number of the autofs mount. The
Packit 8480eb
-device number can be obtained from the mount options shown in
Packit 8480eb
-/proc/mounts. The close call requires an initialized struct
Packit 8480eb
-autofs_dev_ioct with the ioctlfd field set to the descriptor obtained
Packit 8480eb
-from the open call. The release of the file descriptor can also be done
Packit 8480eb
-with close(2) so any open descriptors will also be closed at process exit.
Packit 8480eb
-The close call is included in the implemented operations largely for
Packit 8480eb
-completeness and to provide for a consistent user space implementation.
Packit 8480eb
+as the openmount.devid field set to the device number of the autofs mount.
Packit 8480eb
+The device number of an autofs mounted filesystem can be obtained by using
Packit 8480eb
+the AUTOFS_DEV_IOCTL_ISMOUNTPOINT ioctl function by providing the path
Packit 8480eb
+and autofs mount type, as described below. The close call requires an
Packit 8480eb
+initialized struct autofs_dev_ioct with the ioctlfd field set to the
Packit 8480eb
+descriptor obtained from the open call. The release of the file descriptor
Packit 8480eb
+can also be done with close(2) so any open descriptors will also be
Packit 8480eb
+closed at process exit. The close call is included in the implemented
Packit 8480eb
+operations largely for completeness and to provide for a consistent
Packit 8480eb
+user space implementation.
Packit 8480eb
 
Packit 8480eb
 
Packit 8480eb
 AUTOFS_DEV_IOCTL_READY_CMD and AUTOFS_DEV_IOCTL_FAIL_CMD
Packit 8480eb
@@ -272,10 +287,10 @@ AUTOFS_DEV_IOCTL_READY_CMD and AUTOFS_DE
Packit 8480eb
 Return mount and expire result status from user space to the kernel.
Packit 8480eb
 Both of these calls require an initialized struct autofs_dev_ioctl
Packit 8480eb
 with the ioctlfd field set to the descriptor obtained from the open
Packit 8480eb
-call and the arg1 field set to the wait queue token number, received
Packit 8480eb
-by user space in the foregoing mount or expire request. The arg2 field
Packit 8480eb
-is set to the status to be returned. For the ready call this is always
Packit 8480eb
-0 and for the fail call it is set to the errno of the operation.
Packit 8480eb
+call and the ready.token or fail.token field set to the wait queue
Packit 8480eb
+token number, received by user space in the foregoing mount or expire
Packit 8480eb
+request. The fail.status field is set to the status to be returned when
Packit 8480eb
+sending a failure notification with AUTOFS_DEV_IOCTL_FAIL_CMD.
Packit 8480eb
 
Packit 8480eb
 
Packit 8480eb
 AUTOFS_DEV_IOCTL_SETPIPEFD_CMD
Packit 8480eb
@@ -290,9 +305,10 @@ mount be catatonic (see next call).
Packit 8480eb
 
Packit 8480eb
 The call requires an initialized struct autofs_dev_ioctl with the
Packit 8480eb
 ioctlfd field set to the descriptor obtained from the open call and
Packit 8480eb
-the arg1 field set to descriptor of the pipe. On success the call
Packit 8480eb
-also sets the process group id used to identify the controlling process
Packit 8480eb
-(eg. the owning automount(8) daemon) to the process group of the caller.
Packit 8480eb
+the setpipefd.pipefd field set to descriptor of the pipe. On success
Packit 8480eb
+the call also sets the process group id used to identify the controlling
Packit 8480eb
+process (eg. the owning automount(8) daemon) to the process group of
Packit 8480eb
+the caller.
Packit 8480eb
 
Packit 8480eb
 
Packit 8480eb
 AUTOFS_DEV_IOCTL_CATATONIC_CMD
Packit 8480eb
@@ -313,6 +329,9 @@ Set the expire timeout for mounts within
Packit 8480eb
 
Packit 8480eb
 The call requires an initialized struct autofs_dev_ioctl with the
Packit 8480eb
 ioctlfd field set to the descriptor obtained from the open call.
Packit 8480eb
+The timeout.timeout field is set to the desired timeout and this
Packit 8480eb
+field is set to the value of the value of the current timeout of
Packit 8480eb
+the mount upon successful completion.
Packit 8480eb
 
Packit 8480eb
 
Packit 8480eb
 AUTOFS_DEV_IOCTL_REQUESTER_CMD
Packit 8480eb
@@ -323,9 +342,9 @@ mount on the given path dentry.
Packit 8480eb
 
Packit 8480eb
 The call requires an initialized struct autofs_dev_ioctl with the path
Packit 8480eb
 field set to the mount point in question and the size field adjusted
Packit 8480eb
-appropriately as well as the arg1 field set to the device number of the
Packit 8480eb
-containing autofs mount. Upon return the struct field arg1 contains the
Packit 8480eb
-uid and arg2 the gid.
Packit 8480eb
+appropriately as well as the ioctlfd field set to the descriptor obtained
Packit 8480eb
+from the open call. Upon return the struct fields requester.uid and
Packit 8480eb
+requester.gid contain the uid and gid respectively.
Packit 8480eb
 
Packit 8480eb
 When reconstructing an autofs mount tree with active mounts we need to
Packit 8480eb
 re-connect to mounts that may have used the original process uid and
Packit 8480eb
@@ -343,8 +362,8 @@ this ioctl is called until no further ex
Packit 8480eb
 The call requires an initialized struct autofs_dev_ioctl with the
Packit 8480eb
 ioctlfd field set to the descriptor obtained from the open call. In
Packit 8480eb
 addition an immediate expire, independent of the mount timeout, can be
Packit 8480eb
-requested by setting the arg1 field to 1. If no expire candidates can
Packit 8480eb
-be found the ioctl returns -1 with errno set to EAGAIN.
Packit 8480eb
+requested by setting the expire.how field to 1. If no expire candidates
Packit 8480eb
+can be found the ioctl returns -1 with errno set to EAGAIN.
Packit 8480eb
 
Packit 8480eb
 This call causes the kernel module to check the mount corresponding
Packit 8480eb
 to the given ioctlfd for mounts that can be expired, issues an expire
Packit 8480eb
@@ -357,7 +376,8 @@ Checks if an autofs mount point is in us
Packit 8480eb
 
Packit 8480eb
 The call requires an initialized struct autofs_dev_ioctl with the
Packit 8480eb
 ioctlfd field set to the descriptor obtained from the open call and
Packit 8480eb
-it returns the result in the arg1 field, 1 for busy and 0 otherwise.
Packit 8480eb
+it returns the result in the askumount.may_umount field, 1 for busy
Packit 8480eb
+and 0 otherwise.
Packit 8480eb
 
Packit 8480eb
 
Packit 8480eb
 AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD
Packit 8480eb
@@ -367,14 +387,15 @@ Check if the given path is a mountpoint.
Packit 8480eb
 
Packit 8480eb
 The call requires an initialized struct autofs_dev_ioctl. There are two
Packit 8480eb
 possible variations. Both use the path field set to the path of the mount
Packit 8480eb
-point to check and the size field adjusted appropriately. One uses the
Packit 8480eb
-ioctlfd field to identify a specific mount point to check while the other
Packit 8480eb
-variation uses the path and optionaly arg1 set to an autofs mount type.
Packit 8480eb
-The call returns 1 if this is a mount point and sets arg1 to the device
Packit 8480eb
-number of the mount and field arg2 to the relevant super block magic
Packit 8480eb
-number (described below) or 0 if it isn't a mountpoint. In both cases
Packit 8480eb
-the the device number (as returned by new_encode_dev()) is returned
Packit 8480eb
-in field arg1.
Packit 8480eb
+point to check and the size field must be adjusted appropriately. One uses
Packit 8480eb
+the ioctlfd field to identify a specific mount point to check while the
Packit 8480eb
+other variation uses the path and optionaly the ismountpoint.in.type 
Packit 8480eb
+field set to an autofs mount type. The call returns 1 if this is a mount
Packit 8480eb
+point and sets the ismountpoint.out.devid field to the device number of
Packit 8480eb
+the mount and the ismountpoint.out.magic field to the relevant super
Packit 8480eb
+block magic number (described below) or 0 if it isn't a mountpoint. In
Packit 8480eb
+both cases the the device number (as returned by new_encode_dev()) is
Packit 8480eb
+returned in the ismountpoint.out.devid field.
Packit 8480eb
 
Packit 8480eb
 If supplied with a file descriptor we're looking for a specific mount,
Packit 8480eb
 not necessarily at the top of the mounted stack. In this case the path
Packit 8480eb
--- linux-2.6.28.orig/include/linux/auto_dev-ioctl.h
Packit 8480eb
+++ linux-2.6.28/include/linux/auto_dev-ioctl.h
Packit 8480eb
@@ -10,7 +10,13 @@
Packit 8480eb
 #ifndef _LINUX_AUTO_DEV_IOCTL_H
Packit 8480eb
 #define _LINUX_AUTO_DEV_IOCTL_H
Packit 8480eb
 
Packit 8480eb
-#include <linux/types.h>
Packit 8480eb
+#include <linux/auto_fs.h>
Packit 8480eb
+
Packit 8480eb
+#ifdef __KERNEL__
Packit 8480eb
+#include <linux/string.h>
Packit 8480eb
+#else
Packit 8480eb
+#include <string.h>
Packit 8480eb
+#endif /* __KERNEL__ */
Packit 8480eb
 
Packit 8480eb
 #define AUTOFS_DEVICE_NAME		"autofs"
Packit 8480eb
 
Packit 8480eb
@@ -25,6 +31,60 @@
Packit 8480eb
  * An ioctl interface for autofs mount point control.
Packit 8480eb
  */
Packit 8480eb
 
Packit 8480eb
+struct args_protover {
Packit 8480eb
+	__u32	version;
Packit 8480eb
+};
Packit 8480eb
+
Packit 8480eb
+struct args_protosubver {
Packit 8480eb
+	__u32	sub_version;
Packit 8480eb
+};
Packit 8480eb
+
Packit 8480eb
+struct args_openmount {
Packit 8480eb
+	__u32	devid;
Packit 8480eb
+};
Packit 8480eb
+
Packit 8480eb
+struct args_ready {
Packit 8480eb
+	__u32	token;
Packit 8480eb
+};
Packit 8480eb
+
Packit 8480eb
+struct args_fail {
Packit 8480eb
+	__u32	token;
Packit 8480eb
+	__s32	status;
Packit 8480eb
+};
Packit 8480eb
+
Packit 8480eb
+struct args_setpipefd {
Packit 8480eb
+	__s32	pipefd;
Packit 8480eb
+};
Packit 8480eb
+
Packit 8480eb
+struct args_timeout {
Packit 8480eb
+	__u64	timeout;
Packit 8480eb
+};
Packit 8480eb
+
Packit 8480eb
+struct args_requester {
Packit 8480eb
+	__u32	uid;
Packit 8480eb
+	__u32	gid;
Packit 8480eb
+};
Packit 8480eb
+
Packit 8480eb
+struct args_expire {
Packit 8480eb
+	__u32	how;
Packit 8480eb
+};
Packit 8480eb
+
Packit 8480eb
+struct args_askumount {
Packit 8480eb
+	__u32	may_umount;
Packit 8480eb
+};
Packit 8480eb
+
Packit 8480eb
+struct args_ismountpoint {
Packit 8480eb
+	union {
Packit 8480eb
+		struct args_in {
Packit 8480eb
+			__u32	type;
Packit 8480eb
+		} in;
Packit 8480eb
+		struct args_out {
Packit 8480eb
+			__u32	devid;
Packit 8480eb
+			__u32	magic;
Packit 8480eb
+		} out;
Packit 8480eb
+	};
Packit 8480eb
+};
Packit 8480eb
+
Packit 8480eb
 /*
Packit 8480eb
  * All the ioctls use this structure.
Packit 8480eb
  * When sending a path size must account for the total length
Packit 8480eb
@@ -39,20 +99,32 @@ struct autofs_dev_ioctl {
Packit 8480eb
 				 * including this struct */
Packit 8480eb
 	__s32 ioctlfd;		/* automount command fd */
Packit 8480eb
 
Packit 8480eb
-	__u32 arg1;		/* Command parameters */
Packit 8480eb
-	__u32 arg2;
Packit 8480eb
+	/* Command parameters */
Packit 8480eb
+
Packit 8480eb
+	union {
Packit 8480eb
+		struct args_protover		protover;
Packit 8480eb
+		struct args_protosubver		protosubver;
Packit 8480eb
+		struct args_openmount		openmount;
Packit 8480eb
+		struct args_ready		ready;
Packit 8480eb
+		struct args_fail		fail;
Packit 8480eb
+		struct args_setpipefd		setpipefd;
Packit 8480eb
+		struct args_timeout		timeout;
Packit 8480eb
+		struct args_requester		requester;
Packit 8480eb
+		struct args_expire		expire;
Packit 8480eb
+		struct args_askumount		askumount;
Packit 8480eb
+		struct args_ismountpoint	ismountpoint;
Packit 8480eb
+	};
Packit 8480eb
 
Packit 8480eb
 	char path[0];
Packit 8480eb
 };
Packit 8480eb
 
Packit 8480eb
 static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in)
Packit 8480eb
 {
Packit 8480eb
+	memset(in, 0, sizeof(struct autofs_dev_ioctl));
Packit 8480eb
 	in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR;
Packit 8480eb
 	in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR;
Packit 8480eb
 	in->size = sizeof(struct autofs_dev_ioctl);
Packit 8480eb
 	in->ioctlfd = -1;
Packit 8480eb
-	in->arg1 = 0;
Packit 8480eb
-	in->arg2 = 0;
Packit 8480eb
 	return;
Packit 8480eb
 }
Packit 8480eb
 
Packit 8480eb
--- linux-2.6.28.orig/fs/autofs4/root.c
Packit 8480eb
+++ linux-2.6.28/fs/autofs4/root.c
Packit 8480eb
@@ -485,22 +485,6 @@ static struct dentry *autofs4_lookup(str
Packit 8480eb
 	DPRINTK("pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d",
Packit 8480eb
 		 current->pid, task_pgrp_nr(current), sbi->catatonic, oz_mode);
Packit 8480eb
 
Packit 8480eb
-	expiring = autofs4_lookup_expiring(sbi, dentry->d_parent, &dentry->d_name);
Packit 8480eb
-	if (expiring) {
Packit 8480eb
-		/*
Packit 8480eb
-		 * If we are racing with expire the request might not
Packit 8480eb
-		 * be quite complete but the directory has been removed
Packit 8480eb
-		 * so it must have been successful, so just wait for it.
Packit 8480eb
-		 */
Packit 8480eb
-		ino = autofs4_dentry_ino(expiring);
Packit 8480eb
-		autofs4_expire_wait(expiring);
Packit 8480eb
-		spin_lock(&sbi->lookup_lock);
Packit 8480eb
-		if (!list_empty(&ino->expiring))
Packit 8480eb
-			list_del_init(&ino->expiring);
Packit 8480eb
-		spin_unlock(&sbi->lookup_lock);
Packit 8480eb
-		dput(expiring);
Packit 8480eb
-	}
Packit 8480eb
-
Packit 8480eb
 	unhashed = autofs4_lookup_active(sbi, dentry->d_parent, &dentry->d_name);
Packit 8480eb
 	if (unhashed)
Packit 8480eb
 		dentry = unhashed;
Packit 8480eb
@@ -538,14 +522,31 @@ static struct dentry *autofs4_lookup(str
Packit 8480eb
 	}
Packit 8480eb
 
Packit 8480eb
 	if (!oz_mode) {
Packit 8480eb
+		mutex_unlock(&dir->i_mutex);
Packit 8480eb
+		expiring = autofs4_lookup_expiring(sbi,
Packit 8480eb
+						   dentry->d_parent,
Packit 8480eb
+						   &dentry->d_name);
Packit 8480eb
+		if (expiring) {
Packit 8480eb
+			/*
Packit 8480eb
+			 * If we are racing with expire the request might not
Packit 8480eb
+			 * be quite complete but the directory has been removed
Packit 8480eb
+			 * so it must have been successful, so just wait for it.
Packit 8480eb
+			 */
Packit 8480eb
+			ino = autofs4_dentry_ino(expiring);
Packit 8480eb
+			autofs4_expire_wait(expiring);
Packit 8480eb
+			spin_lock(&sbi->lookup_lock);
Packit 8480eb
+			if (!list_empty(&ino->expiring))
Packit 8480eb
+				list_del_init(&ino->expiring);
Packit 8480eb
+			spin_unlock(&sbi->lookup_lock);
Packit 8480eb
+			dput(expiring);
Packit 8480eb
+		}
Packit 8480eb
+
Packit 8480eb
 		spin_lock(&dentry->d_lock);
Packit 8480eb
 		dentry->d_flags |= DCACHE_AUTOFS_PENDING;
Packit 8480eb
 		spin_unlock(&dentry->d_lock);
Packit 8480eb
-		if (dentry->d_op && dentry->d_op->d_revalidate) {
Packit 8480eb
-			mutex_unlock(&dir->i_mutex);
Packit 8480eb
+		if (dentry->d_op && dentry->d_op->d_revalidate)
Packit 8480eb
 			(dentry->d_op->d_revalidate)(dentry, nd);
Packit 8480eb
-			mutex_lock(&dir->i_mutex);
Packit 8480eb
-		}
Packit 8480eb
+		mutex_lock(&dir->i_mutex);
Packit 8480eb
 	}
Packit 8480eb
 
Packit 8480eb
 	/*
Packit 8480eb
--- linux-2.6.28.orig/include/linux/auto_fs.h
Packit 8480eb
+++ linux-2.6.28/include/linux/auto_fs.h
Packit 8480eb
@@ -17,11 +17,13 @@
Packit 8480eb
 #ifdef __KERNEL__
Packit 8480eb
 #include <linux/fs.h>
Packit 8480eb
 #include <linux/limits.h>
Packit 8480eb
+#include <linux/types.h>
Packit 8480eb
+#include <linux/ioctl.h>
Packit 8480eb
+#else
Packit 8480eb
 #include <asm/types.h>
Packit 8480eb
+#include <sys/ioctl.h>
Packit 8480eb
 #endif /* __KERNEL__ */
Packit 8480eb
 
Packit 8480eb
-#include <linux/ioctl.h>
Packit 8480eb
-
Packit 8480eb
 /* This file describes autofs v3 */
Packit 8480eb
 #define AUTOFS_PROTO_VERSION	3
Packit 8480eb