Skip to content

Commit

Permalink
sysfs: Remove usage of S_BIAS to avoid merge conflict with the vfs tree
Browse files Browse the repository at this point in the history
In Al's latest vfs tree the code is reworked and S_BIAS has been removed.

It turns out that checking to see if a super block is in the
middle of an unmount in sysfs_exit_ns is unnecessary because we
remove the super_block from the s_supers/s_instances list before
struct sysfs_super_info pointed to by sb->s_fs_info is freed.

For now just delete the unnecessary check to see if a superblock is in the
middle of an unmount, it isn't necessary with or without Al's changes
and it just causes a needless conflict.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Eric W. Biederman authored and Greg Kroah-Hartman committed May 21, 2010
1 parent 27eabc7 commit 68d75ed
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions fs/sysfs/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down

0 comments on commit 68d75ed

Please sign in to comment.