Skip to contentSkip to conversation

autofs4 - remove ioctl mutex

PATCH In review Ian Kent 3 participants 5 messages Dec 6, 2010

Subsystems (2)
lore
Share & tools
lore

Ian Kent

author maintainer
#0 lore raw

PATCH 1/1 autofs4 - remove ioctl mutex

With the recent changes to remove the BKL a mutex was added to the ioctl entry point for calls to the old ioctl interface. This mutex needs to be removed because of the need for the expire ioctl to call back to the daemon to perform a umount and receive a completion status (via another ioctl).

This should be fine as the new ioctl interface uses much of the same code and it has been used without a mutex for around a year without issue, as was the original intention.
---

 fs/autofs4/root.c |   12 +-----------
 1 files changed, 1 insertions(+), 11 deletions(-)
fs/autofs4/root.c +1 -11
index d5c1401..d34896c 100644
@@ -980,19 +980,11 @@ static int autofs4_root_ioctl_unlocked(struct inode *inode, struct file *filp,
 	}
 }
 
-static DEFINE_MUTEX(autofs4_ioctl_mutex);
-
 static long autofs4_root_ioctl(struct file *filp,
 			       unsigned int cmd, unsigned long arg)
 {
-	long ret;
 	struct inode *inode = filp->f_dentry->d_inode;
-
-	mutex_lock(&autofs4_ioctl_mutex);
-	ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg);
-	mutex_unlock(&autofs4_ioctl_mutex);
-
-	return ret;
+	return autofs4_root_ioctl_unlocked(inode, filp, cmd, arg);
 }
 
 #ifdef CONFIG_COMPAT
@@ -1002,13 +994,11 @@ static long autofs4_root_compat_ioctl(struct file *filp,
 	struct inode *inode = filp->f_path.dentry->d_inode;
 	int ret;
 
-	mutex_lock(&autofs4_ioctl_mutex);
 	if (cmd == AUTOFS_IOC_READY || cmd == AUTOFS_IOC_FAIL)
 		ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg);
 	else
 		ret = autofs4_root_ioctl_unlocked(inode, filp, cmd,
 			(unsigned long)compat_ptr(arg));
-	mutex_unlock(&autofs4_ioctl_mutex);
 
 	return ret;
 }
#1 lore raw
Quoted 9 lines · Ian Kent

With the recent changes to remove the BKL a mutex was added to the ioctl entry point for calls to the old ioctl interface. This mutex needs to be removed because of the need for the expire ioctl to call back to the daemon to perform a umount and receive a completion status (via another ioctl).

This should be fine as the new ioctl interface uses much of the same code and it has been used without a mutex for around a year without issue, as was the original intention.

Sign-off?

Linus

author maintainer
#2 lore raw
Quoted 7 lines · Linus Torvalds
Quoted 6 lines · Ian Kent

With the recent changes to remove the BKL a mutex was added to the ioctl entry point for calls to the old ioctl interface. This mutex needs to be removed because of the need for the expire ioctl to call back to the daemon to perform a umount and receive a completion status (via another ioctl).

Quoted 5 lines
Quoted 3 lines

This should be fine as the new ioctl interface uses much of the same code and it has been used without a mutex for around a year without issue, as was the original intention.

Sign-off?

Oops, sorry.
Would you like me to re-send after asking those concerned if I can add their sign-off, and adding mine of course?

Ian

#3 lore raw
Quoted 3 lines · Ian Kent

Would you like me to re-send after asking those concerned if I can add their sign-off, and adding mine of course?

Yes, please re-send with the proper sign-offs. Based on the email that _should_ just be yours (since there was no other author listed), but if it came to you from somebody else, please make sure you have their sign-off too and list them as the original author.

Linus

Acked-by on v1 1/1
#4 lore raw
In reply to Ian Kent
Quoted 9 lines · On Monday 06 December 2010 04:51:23 Ian Kent wrote:

With the recent changes to remove the BKL a mutex was added to the ioctl entry point for calls to the old ioctl interface. This mutex needs to be removed because of the need for the expire ioctl to call back to the daemon to perform a umount and receive a completion status (via another ioctl).

This should be fine as the new ioctl interface uses much of the same code and it has been used without a mutex for around a year without issue, as was the original intention.