Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sysfs: Remove usage of S_BIAS to avoid merge conflict with the vfs tree

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>

authored by

Eric W. Biederman and committed by
Greg Kroah-Hartman
68d75ed4 27eabc7c

+8 -3
+8 -3
fs/sysfs/mount.c
··· 138 138 { 139 139 struct sysfs_super_info *info = sysfs_info(sb); 140 140 141 + /* Remove the superblock from fs_supers/s_instances 142 + * so we can't find it, before freeing sysfs_super_info. 143 + */ 141 144 kill_anon_super(sb); 142 145 kfree(info); 143 146 } ··· 159 156 spin_lock(&sb_lock); 160 157 list_for_each_entry(sb, &sysfs_fs_type.fs_supers, s_instances) { 161 158 struct sysfs_super_info *info = sysfs_info(sb); 162 - /* Ignore superblocks that are in the process of unmounting */ 163 - if (sb->s_count <= S_BIAS) 164 - continue; 159 + /* 160 + * If we see a superblock on the fs_supers/s_instances 161 + * list the unmount has not completed and sb->s_fs_info 162 + * points to a valid struct sysfs_super_info. 163 + */ 165 164 /* Ignore superblocks with the wrong ns */ 166 165 if (info->ns[type] != ns) 167 166 continue;