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

orangefs: put register_chrdev immediately before register_filesystem

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>

authored by

Martin Brandenburg and committed by
Mike Marshall
2f83ace3 a4c680a0

+13 -13
+13 -13
fs/orangefs/orangefs-mod.c
··· 144 144 if (ret < 0) 145 145 goto cleanup_op; 146 146 147 - /* Initialize the orangefsdev subsystem. */ 148 - ret = orangefs_dev_init(); 149 - if (ret < 0) { 150 - gossip_err("%s: could not initialize device subsystem %d!\n", 151 - __func__, 152 - ret); 153 - goto cleanup_inode; 154 - } 155 - 156 147 htable_ops_in_progress = 157 148 kcalloc(hash_table_size, sizeof(struct list_head), GFP_KERNEL); 158 149 if (!htable_ops_in_progress) { 159 150 gossip_err("Failed to initialize op hashtable"); 160 151 ret = -ENOMEM; 161 - goto cleanup_device; 152 + goto cleanup_inode; 162 153 } 163 154 164 155 /* initialize a doubly linked at each hash table index */ ··· 189 198 if (ret) 190 199 goto sysfs_init_failed; 191 200 201 + /* Initialize the orangefsdev subsystem. */ 202 + ret = orangefs_dev_init(); 203 + if (ret < 0) { 204 + gossip_err("%s: could not initialize device subsystem %d!\n", 205 + __func__, 206 + ret); 207 + goto cleanup_device; 208 + } 209 + 192 210 ret = register_filesystem(&orangefs_fs_type); 193 211 if (ret == 0) { 194 212 pr_info("orangefs: module version %s loaded\n", ORANGEFS_VERSION); ··· 206 206 } 207 207 208 208 orangefs_sysfs_exit(); 209 + 210 + cleanup_device: 211 + orangefs_dev_cleanup(); 209 212 210 213 sysfs_init_failed: 211 214 ··· 222 219 223 220 cleanup_progress_table: 224 221 kfree(htable_ops_in_progress); 225 - 226 - cleanup_device: 227 - orangefs_dev_cleanup(); 228 222 229 223 cleanup_inode: 230 224 orangefs_inode_cache_finalize();