Merge tag 'usercopy-v4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees...
[linux-2.6-block.git] / fs / exofs / super.c
index 7e244093c0e51b9102b6c413f7f0862d04e6bf3a..179cd5c2f52ac5f5199af0ae1002ddf9797037e5 100644 (file)
@@ -193,10 +193,13 @@ static void exofs_init_once(void *foo)
  */
 static int init_inodecache(void)
 {
-       exofs_inode_cachep = kmem_cache_create("exofs_inode_cache",
+       exofs_inode_cachep = kmem_cache_create_usercopy("exofs_inode_cache",
                                sizeof(struct exofs_i_info), 0,
                                SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD |
-                               SLAB_ACCOUNT, exofs_init_once);
+                               SLAB_ACCOUNT,
+                               offsetof(struct exofs_i_info, i_data),
+                               sizeof_field(struct exofs_i_info, i_data),
+                               exofs_init_once);
        if (exofs_inode_cachep == NULL)
                return -ENOMEM;
        return 0;