Merge tag 'for-linus-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap...
[muen/linux.git] / fs / orangefs / super.c
index b28b75c7d275eebf8264e88286f5012720211de8..3ae5fdba0225b5670491b9cbfbf68be7bccf84a9 100644 (file)
@@ -610,11 +610,16 @@ void orangefs_kill_sb(struct super_block *sb)
 
 int orangefs_inode_cache_initialize(void)
 {
-       orangefs_inode_cache = kmem_cache_create("orangefs_inode_cache",
-                                             sizeof(struct orangefs_inode_s),
-                                             0,
-                                             ORANGEFS_CACHE_CREATE_FLAGS,
-                                             orangefs_inode_cache_ctor);
+       orangefs_inode_cache = kmem_cache_create_usercopy(
+                                       "orangefs_inode_cache",
+                                       sizeof(struct orangefs_inode_s),
+                                       0,
+                                       ORANGEFS_CACHE_CREATE_FLAGS,
+                                       offsetof(struct orangefs_inode_s,
+                                               link_target),
+                                       sizeof_field(struct orangefs_inode_s,
+                                               link_target),
+                                       orangefs_inode_cache_ctor);
 
        if (!orangefs_inode_cache) {
                gossip_err("Cannot create orangefs_inode_cache\n");