]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fs/fuse: Fix for correct number of numa nodes
authorBabu Moger <babu.moger@oracle.com>
Wed, 21 Jun 2017 23:22:09 +0000 (17:22 -0600)
committerAllen Pais <allen.pais@oracle.com>
Thu, 29 Jun 2017 08:09:44 +0000 (13:39 +0530)
commit2d61151b83624d4b64909fe808a416875f85e58e
tree0a028ec151456c4c5eb5f9815ca1373f86e7ce08
parent29f312420d3a9dc67677c52396ced02a4657135a
fs/fuse: Fix for correct number of numa nodes

When fuse filesystem is mounted it sets up data structure
for all the available numa nodes(with -o numa). However,
it uses nr_node_ids which is set to MAX_NUMNODES(16). This
causes following panic when kmalloc_node is called.

Call Trace:
[00000000005cb0bc] allocate_slab+0x9c/0x2e0
[00000000005cb48c] new_slab+0x2c/0x220
[00000000005cc84c] __slab_alloc+0x2ec/0x3c0
[00000000005cec60] kmem_cache_alloc_node_trace+0xa0/0x2c0
[0000000010608870] fuse_conn_init+0x150/0x2a0 [fuse]
[0000000010609128] fuse_fill_super+0x128/0x440 [fuse]
[00000000005e6040] mount_nodev+0x40/0xa0
[00000000106074fc] fuse_mount+0x1c/0x40 [fuse]
[00000000005e5e14] mount_fs+0x34/0x160
[0000000000606c04] vfs_kern_mount+0x44/0xe0
[0000000000606ec8] do_new_mount+0x1e8/0x300
[00000000006071a4] do_mount+0x1c4/0x220
[0000000000607260] SyS_mount+0x60/0xa0
[00000000004062d4] linux_sparc_syscall+0x34/0x44

Fix it by setting it to only online node(nr_online_nodes).
Also fix the case with FUSE_CPU with num_present_cpus.

This started happening only after we moved to SLUB allocation.
Slab allocation uses fallback_alloc method when node is not valid.

This panic happens only on SPARC. In x86, nr_node_ids is set to
only available nodes.

Orabug: 25947102

Signed-off-by: Babu Moger <babu.moger@oracle.com>
Reviewed-by: Ashish Samant <ashish.samant@oracle.com>
Reviewed-by: Jane Chu <jane.chu@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
fs/fuse/inode.c