mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: David Herrmann <dh.herrmann@googlemail.com>
Cc: fuse-devel@lists.sourceforge.net,
	Miklos Szeredi <miklos@szeredi.hu>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] cuse: use mutex as registration lock instead of spinlocks
Date: Sun, 18 Nov 2012 06:29:20 -0800	[thread overview]
Message-ID: <20121118142920.GG7306@mtj.dyndns.org> (raw)
In-Reply-To: <1353152748-6867-1-git-send-email-dh.herrmann@googlemail.com>

Hello, David.

On Sat, Nov 17, 2012 at 12:45:47PM +0100, David Herrmann wrote:
> We need to check for name-collisions during cuse-device registration. To
> avoid race-conditions, this needs to be protected during the whole device
> registration. Therefore, replace the spinlocks by mutexes first so we can
> safely extend the locked regions to include more expensive or sleeping
> code paths.
> 
> Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
> @@ -114,14 +113,18 @@ static int cuse_open(struct inode *inode, struct file *file)
>  	int rc;
>  
>  	/* look up and get the connection */
> -	spin_lock(&cuse_lock);
> +	rc = mutex_lock_interruptible(&cuse_lock);

Well, the above can't hurt but it doesn't help anything either given
the narrow scope of the lock.  Eh well, I guess it's okay either way.

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

      parent reply	other threads:[~2012-11-18 14:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-17 11:45 David Herrmann
2012-11-17 11:45 ` [PATCH v3 2/2] cuse: do not register multiple devices with identical names David Herrmann
2012-11-18 14:30   ` Tejun Heo
2012-11-19  7:18     ` Miklos Szeredi
2012-11-18 14:29 ` Tejun Heo [this message]

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=20121118142920.GG7306@mtj.dyndns.org \
    --to=tj@kernel.org \
    --cc=dh.herrmann@googlemail.com \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome