]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] fix for get_sb_bdev() bug
authorAlexander Viro <viro@math.psu.edu>
Mon, 11 Mar 2002 06:22:18 +0000 (22:22 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Mon, 11 Mar 2002 06:22:18 +0000 (22:22 -0800)
Grr...  When loop in get_sb_bdev() had been switched from
global list of superblock to per-type one, we should have switched
from sb_entry(p) (aka. list_entry(p, struct super_block, s_list)) to
list_entry(p, struct super_block, s_instances).

As it is, we end up with false negatives all the time.  I.e.
second mount from the same block device with the same type gices
a new superblock.  With obvious nasty results...

This fixes that.

fs/super.c

index 149e89ec125cc3d922e89b9235a6f5cccd6a08a1..e83164f1063441d43d6e30b1951096912f46fcb5 100644 (file)
@@ -728,7 +728,8 @@ restart:
        spin_lock(&sb_lock);
 
        list_for_each(p, &fs_type->fs_supers) {
-               struct super_block *old = sb_entry(p);
+               struct super_block *old;
+               old = list_entry(p, struct super_block, s_instances);
                if (old->s_bdev != bdev)
                        continue;
                if (!grab_super(old))