From: NeilBrown <neilb@suse.de>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] VFS: use __put_super_and_need_restart in get_active_super.
Date: Wed, 24 Mar 2010 16:12:23 +1100 [thread overview]
Message-ID: <20100324051223.10015.75309.stgit@notabene.brown> (raw)
In-Reply-To: <20100324051140.10015.32854.stgit@notabene.brown>
The recently-added get_active_super() walks the super_blocks
list but unlike all other code that walks this list it does
not use __put_super_and_need_restart().
I believe this is an omission that should be fixed.
cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: NeilBrown <neilb@suse.de>
---
fs/super.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fs/super.c b/fs/super.c
index f35ac60..34c8391 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -482,6 +482,7 @@ struct super_block *get_active_super(struct block_device *bdev)
return NULL;
spin_lock(&sb_lock);
+restart:
list_for_each_entry(sb, &super_blocks, s_list) {
if (sb->s_bdev != bdev)
continue;
@@ -500,9 +501,10 @@ struct super_block *get_active_super(struct block_device *bdev)
spin_unlock(&sb_lock);
}
up_write(&sb->s_umount);
- put_super(sb);
yield();
spin_lock(&sb_lock);
+ if (__put_super_and_need_restart(sb))
+ goto restart;
}
spin_unlock(&sb_lock);
return NULL;
next prev parent reply other threads:[~2010-03-24 5:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-24 5:12 [PATCH 0/2] Two patches for fs/super.c NeilBrown
2010-03-24 5:12 ` NeilBrown [this message]
2010-03-24 5:12 ` [PATCH 2/2] fs/super: remove S_BIAS NeilBrown
2010-03-24 9:20 ` [PATCH 0/2] Two patches for fs/super.c Al Viro
2010-03-24 9:50 ` Neil Brown
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=20100324051223.10015.75309.stgit@notabene.brown \
--to=neilb@suse.de \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/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
all inboxes | Powered by JetHome®