|
@@ -425,7 +425,7 @@ void sync_supers(void)
|
|
* mounted on the device given. %NULL is returned if no match is found.
|
|
* 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;
|
|
struct super_block *sb;
|
|
|
|
|
|
@@ -441,13 +441,14 @@ rescan:
|
|
sb->s_count++;
|
|
sb->s_count++;
|
|
spin_unlock(&sb_lock);
|
|
spin_unlock(&sb_lock);
|
|
down_read(&sb->s_umount);
|
|
down_read(&sb->s_umount);
|
|
|
|
+ /* still alive? */
|
|
if (sb->s_root)
|
|
if (sb->s_root)
|
|
return sb;
|
|
return sb;
|
|
up_read(&sb->s_umount);
|
|
up_read(&sb->s_umount);
|
|
- /* restart only when sb is no longer on the list */
|
|
|
|
|
|
+ /* nope, got unmounted */
|
|
spin_lock(&sb_lock);
|
|
spin_lock(&sb_lock);
|
|
- if (__put_super_and_need_restart(sb))
|
|
|
|
- goto rescan;
|
|
|
|
|
|
+ __put_super(sb);
|
|
|
|
+ goto rescan;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
spin_unlock(&sb_lock);
|
|
spin_unlock(&sb_lock);
|
|
@@ -487,7 +488,7 @@ restart:
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
|
|
-struct super_block * user_get_super(dev_t dev)
|
|
|
|
|
|
+struct super_block *user_get_super(dev_t dev)
|
|
{
|
|
{
|
|
struct super_block *sb;
|
|
struct super_block *sb;
|
|
|
|
|
|
@@ -500,13 +501,14 @@ rescan:
|
|
sb->s_count++;
|
|
sb->s_count++;
|
|
spin_unlock(&sb_lock);
|
|
spin_unlock(&sb_lock);
|
|
down_read(&sb->s_umount);
|
|
down_read(&sb->s_umount);
|
|
|
|
+ /* still alive? */
|
|
if (sb->s_root)
|
|
if (sb->s_root)
|
|
return sb;
|
|
return sb;
|
|
up_read(&sb->s_umount);
|
|
up_read(&sb->s_umount);
|
|
- /* restart only when sb is no longer on the list */
|
|
|
|
|
|
+ /* nope, got unmounted */
|
|
spin_lock(&sb_lock);
|
|
spin_lock(&sb_lock);
|
|
- if (__put_super_and_need_restart(sb))
|
|
|
|
- goto rescan;
|
|
|
|
|
|
+ __put_super(sb);
|
|
|
|
+ goto rescan;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
spin_unlock(&sb_lock);
|
|
spin_unlock(&sb_lock);
|