Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21d0f4fa authored by Eric Biggers's avatar Eric Biggers Committed by Theodore Ts'o
Browse files

mbcache: don't BUG() if entry cache cannot be allocated



mbcache can be a module that is loaded long after startup, when someone
asks to mount an ext2 or ext4 filesystem.  Therefore it should not BUG()
if kmem_cache_create() fails, but rather just fail the module load.

Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
parent 918b7306
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -420,7 +420,8 @@ static int __init mbcache_init(void)
	mb_entry_cache = kmem_cache_create("mbcache",
				sizeof(struct mb_cache_entry), 0,
				SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, NULL);
	BUG_ON(!mb_entry_cache);
	if (!mb_entry_cache)
		return -ENOMEM;
	return 0;
}