From c7522635c7e4810d82748de2fe70aebef6157071 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Tue, 18 May 2010 12:58:33 -0700 Subject: [PATCH] --- yaml --- r: 196060 b: refs/heads/master c: 68d75ed4b84a0806ecd4bc14da4759713b23a532 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/sysfs/mount.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index f91386b7545b..e4253592b082 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 27eabc7cb4b357c68e4ce77d0b014f7a23add752 +refs/heads/master: 68d75ed4b84a0806ecd4bc14da4759713b23a532 diff --git a/trunk/fs/sysfs/mount.c b/trunk/fs/sysfs/mount.c index 1afa32ba242c..281c0c9bc39f 100644 --- a/trunk/fs/sysfs/mount.c +++ b/trunk/fs/sysfs/mount.c @@ -138,6 +138,9 @@ static void sysfs_kill_sb(struct super_block *sb) { struct sysfs_super_info *info = sysfs_info(sb); + /* Remove the superblock from fs_supers/s_instances + * so we can't find it, before freeing sysfs_super_info. + */ kill_anon_super(sb); kfree(info); } @@ -156,9 +159,11 @@ void sysfs_exit_ns(enum kobj_ns_type type, const void *ns) spin_lock(&sb_lock); list_for_each_entry(sb, &sysfs_fs_type.fs_supers, s_instances) { struct sysfs_super_info *info = sysfs_info(sb); - /* Ignore superblocks that are in the process of unmounting */ - if (sb->s_count <= S_BIAS) - continue; + /* + * If we see a superblock on the fs_supers/s_instances + * list the unmount has not completed and sb->s_fs_info + * points to a valid struct sysfs_super_info. + */ /* Ignore superblocks with the wrong ns */ if (info->ns[type] != ns) continue;