All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: andreas.bombe@munich.netsurf.de
Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [PATCH] remove BKL from ieee1394_core release function
Date: Fri, 05 Apr 2002 11:11:28 -0800	[thread overview]
Message-ID: <3CADF6E0.6060402@us.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 281 bytes --]

I produced a similar patch for 2.5 which I discussed on the ieee1394 
mailing list a few weeks ago.  We decided that this was a safe and 
BKL-free approach.  Here is a patch to do the same thing for 2.4.19-pre6.

Please forward on to Marcello.

-- 
Dave Hansen
haveblue@us.ibm.com

[-- Attachment #2: ieee1394_core-bkl_remove-2.4.19-pre6.patch --]
[-- Type: text/plain, Size: 1333 bytes --]

--- linux-2.4.19-pre6-clean/drivers/ieee1394/ieee1394_core.c	Fri Apr  5 09:37:37 2002
+++ linux/drivers/ieee1394/ieee1394_core.c	Fri Apr  5 10:51:46 2002
@@ -906,17 +906,16 @@
 
 	/* printk("ieee1394_dispatch_open(%d)", blocknum); */
 
-	/* lock the whole kernel here, to prevent a driver from
-	   being unloaded between the file_ops lookup and the open */
-
-	lock_kernel();
-
 	read_lock(&ieee1394_chardevs_lock);
-	file_ops = ieee1394_chardevs[blocknum].file_ops;
 	module = ieee1394_chardevs[blocknum].module;
+	/* bump the reference count of the driver that
+	   will receive the open() */
+	INCREF(module);
+	file_ops = ieee1394_chardevs[blocknum].file_ops;
 	read_unlock(&ieee1394_chardevs_lock);
 
 	if(file_ops == NULL) {
+		DECREF(module);
 		goto out_fail;
 	}
 
@@ -924,10 +923,6 @@
 	   own file_operations */
 	file->f_op = file_ops;
 
-	/* bump the reference count of the driver that
-	   will receive the open() */
-	INCREF(module);
-	
 	/* at this point BOTH ieee1394 and the task-specific driver have
 	   an extra reference */
 
@@ -956,7 +951,6 @@
 		   and will be dropped by the VFS when the file is
 		   released. */
 		
-		unlock_kernel();
 		return 0;
 	}
 	       
@@ -966,7 +960,6 @@
 	   function returns. */
 	
 	file->f_op = &ieee1394_chardev_ops;
-	unlock_kernel();
 	return retval;
 
 #undef INCREF

             reply	other threads:[~2002-04-05 19:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-05 19:11 Dave Hansen [this message]
2002-04-05 20:10 ` [PATCH] remove BKL from ieee1394_core release function Ben Collins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3CADF6E0.6060402@us.ibm.com \
    --to=haveblue@us.ibm.com \
    --cc=andreas.bombe@munich.netsurf.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.