linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: sdrb <sdrb@onet.eu>
To: linux-fsdevel@vger.kernel.org
Subject: Semaphore should be released in get_super
Date: Tue, 24 May 2011 12:06:15 +0200	[thread overview]
Message-ID: <4DDB8317.7040300@onet.eu> (raw)

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

Hello,

Probably I found a bug in get_super() proc. I think there should be 
semaphore released before return sb.
I attached diff file.

regards,
sdrb

[-- Attachment #2: super.diff --]
[-- Type: text/x-patch, Size: 386 bytes --]

diff --git a/fs/super.c b/fs/super.c
index c04f7e0..361bbec 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -473,8 +473,10 @@ rescan:
 			spin_unlock(&sb_lock);
 			down_read(&sb->s_umount);
 			/* still alive? */
-			if (sb->s_root)
+			if (sb->s_root) {
+				up_read(&sb->s_umount);
 				return sb;
+			}
 			up_read(&sb->s_umount);
 			/* nope, got unmounted */
 			spin_lock(&sb_lock);

             reply	other threads:[~2011-05-24 10:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-24 10:06 sdrb [this message]
2011-05-24 11:20 ` Semaphore should be released in get_super Matthew Wilcox
2011-05-24 12:04   ` sdrb

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=4DDB8317.7040300@onet.eu \
    --to=sdrb@onet.eu \
    --cc=linux-fsdevel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).