Skip to contentSkip to conversation

Btrfs: use late_initcall instead of module_init

PATCH New Filipe David Borba Manana 2 participants 2 messages Feb 1, 2014 – Feb 4, 2014 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: use late_initcall instead of module_init

It seems that when init_btrfs_fs() is called, crc32c/crc32c-intel might not always be already initialized, which results in the call to crypto_alloc_shash() returning -ENOENT, as experienced by Ahmet who reported this.

Therefore make sure init_btrfs_fs() is called after crc32c is initialized (which is at initialization level 6, module_init), by using late_initcall (which is at initialization level 7) instead of module_init for btrfs.

---
 fs/btrfs/super.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/super.c +1 -1
index c02f633..97cc241 100644
@@ -1996,7 +1996,7 @@ static void __exit exit_btrfs_fs(void)
 	btrfs_hash_exit();
 }
 
-module_init(init_btrfs_fs)
+late_initcall(init_btrfs_fs);
 module_exit(exit_btrfs_fs)
 
 MODULE_LICENSE("GPL");
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 Btrfs: use late_initcall instead of module_init

Hey,

as discussed on IRC, this makes 3.14-rc1 able tomount brtfs again. Key difference (aside from being (un)able to mount) is that btrfs now actually shows up in /proc/filesystems, where with vanilla 3.14-rc1 it does not.

Tested on an i5-3470T.