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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'configfs-5.17-2022-02-25' of git://git.infradead.org/users/hch/configfs

Pull configfs fix from Christoph Hellwig:

- fix a race in configfs_{,un}register_subsystem (ChenXiaoSong)

* tag 'configfs-5.17-2022-02-25' of git://git.infradead.org/users/hch/configfs:
configfs: fix a race in configfs_{,un}register_subsystem()

+14
+14
fs/configfs/dir.c
··· 34 34 */ 35 35 DEFINE_SPINLOCK(configfs_dirent_lock); 36 36 37 + /* 38 + * All of link_obj/unlink_obj/link_group/unlink_group require that 39 + * subsys->su_mutex is held. 40 + * But parent configfs_subsystem is NULL when config_item is root. 41 + * Use this mutex when config_item is root. 42 + */ 43 + static DEFINE_MUTEX(configfs_subsystem_mutex); 44 + 37 45 static void configfs_d_iput(struct dentry * dentry, 38 46 struct inode * inode) 39 47 { ··· 1867 1859 group->cg_item.ci_name = group->cg_item.ci_namebuf; 1868 1860 1869 1861 sd = root->d_fsdata; 1862 + mutex_lock(&configfs_subsystem_mutex); 1870 1863 link_group(to_config_group(sd->s_element), group); 1864 + mutex_unlock(&configfs_subsystem_mutex); 1871 1865 1872 1866 inode_lock_nested(d_inode(root), I_MUTEX_PARENT); 1873 1867 ··· 1894 1884 inode_unlock(d_inode(root)); 1895 1885 1896 1886 if (err) { 1887 + mutex_lock(&configfs_subsystem_mutex); 1897 1888 unlink_group(group); 1889 + mutex_unlock(&configfs_subsystem_mutex); 1898 1890 configfs_release_fs(); 1899 1891 } 1900 1892 put_fragment(frag); ··· 1943 1931 1944 1932 dput(dentry); 1945 1933 1934 + mutex_lock(&configfs_subsystem_mutex); 1946 1935 unlink_group(group); 1936 + mutex_unlock(&configfs_subsystem_mutex); 1947 1937 configfs_release_fs(); 1948 1938 } 1949 1939