netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][DLCI]: Fix tiny race between module unload and sock_ioctl.
@ 2008-03-21 16:00 Pavel Emelyanov
  2008-03-21 22:59 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2008-03-21 16:00 UTC (permalink / raw)
  To: David Miller; +Cc: Mike McLagan, Linux Netdev List

This is a narrow pedantry :) but the dlci_ioctl_hook check and call
should not be parted with the mutex lock.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/net/socket.c b/net/socket.c
index b6d35cd..9d3fbfb 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -909,11 +909,10 @@ static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg)
 			if (!dlci_ioctl_hook)
 				request_module("dlci");
 
-			if (dlci_ioctl_hook) {
-				mutex_lock(&dlci_ioctl_mutex);
+			mutex_lock(&dlci_ioctl_mutex);
+			if (dlci_ioctl_hook)
 				err = dlci_ioctl_hook(cmd, argp);
-				mutex_unlock(&dlci_ioctl_mutex);
-			}
+			mutex_unlock(&dlci_ioctl_mutex);
 			break;
 		default:
 			err = sock->ops->ioctl(sock, cmd, arg);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][DLCI]: Fix tiny race between module unload and sock_ioctl.
  2008-03-21 16:00 [PATCH][DLCI]: Fix tiny race between module unload and sock_ioctl Pavel Emelyanov
@ 2008-03-21 22:59 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-03-21 22:59 UTC (permalink / raw)
  To: xemul; +Cc: mike.mclagan, netdev

From: Pavel Emelyanov <xemul@openvz.org>
Date: Fri, 21 Mar 2008 19:00:49 +0300

> This is a narrow pedantry :) but the dlci_ioctl_hook check and call
> should not be parted with the mutex lock.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-21 22:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-21 16:00 [PATCH][DLCI]: Fix tiny race between module unload and sock_ioctl Pavel Emelyanov
2008-03-21 22:59 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).