summaryrefslogtreecommitdiff
path: root/fs/super.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-03-23 03:23:25 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2010-05-22 02:31:16 +0400
commitdf40c01a9249873e4ad0625ae5d9fb831962b75c (patch)
tree9d049e176ad6a329e040faa32d6ee5933d1cea58 /fs/super.c
parent1494583de59dfad2e3a6788ce9817e658d32df22 (diff)
downloadlinux-df40c01a9249873e4ad0625ae5d9fb831962b75c.tar.xz
In get_super() and user_get_super() restarts are unconditional
If superblock had been still alive, we would've returned it... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/super.c b/fs/super.c
index 44971d7df1ce..1f72e0d42d8f 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -425,7 +425,7 @@ void sync_supers(void)
* mounted on the device given. %NULL is returned if no match is found.
*/
-struct super_block * get_super(struct block_device *bdev)
+struct super_block *get_super(struct block_device *bdev)
{
struct super_block *sb;
@@ -441,13 +441,14 @@ rescan:
sb->s_count++;
spin_unlock(&sb_lock);
down_read(&sb->s_umount);
+ /* still alive? */
if (sb->s_root)
return sb;
up_read(&sb->s_umount);
- /* restart only when sb is no longer on the list */
+ /* nope, got unmounted */
spin_lock(&sb_lock);
- if (__put_super_and_need_restart(sb))
- goto rescan;
+ __put_super(sb);
+ goto rescan;
}
}
spin_unlock(&sb_lock);
@@ -487,7 +488,7 @@ restart:
return NULL;
}
-struct super_block * user_get_super(dev_t dev)
+struct super_block *user_get_super(dev_t dev)
{
struct super_block *sb;
@@ -500,13 +501,14 @@ rescan:
sb->s_count++;
spin_unlock(&sb_lock);
down_read(&sb->s_umount);
+ /* still alive? */
if (sb->s_root)
return sb;
up_read(&sb->s_umount);
- /* restart only when sb is no longer on the list */
+ /* nope, got unmounted */
spin_lock(&sb_lock);
- if (__put_super_and_need_restart(sb))
- goto rescan;
+ __put_super(sb);
+ goto rescan;
}
}
spin_unlock(&sb_lock);