Skip to content

Commit 1d18a15

Browse files
Don BradyDelphix Engineering
Don Brady
authored and
Delphix Engineering
committed
DLPX-74216 nfs-server restarts fail when order-5 allocations are exhausted (#3)
1 parent ec26bba commit 1d18a15

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/nfsd/filecache.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,8 @@ nfsd_file_cache_init(void)
579579
if (nfsd_file_hashtbl)
580580
return 0;
581581

582-
nfsd_file_hashtbl = kcalloc(NFSD_FILE_HASH_SIZE,
583-
sizeof(*nfsd_file_hashtbl), GFP_KERNEL);
582+
nfsd_file_hashtbl = kvzalloc(array_size(NFSD_FILE_HASH_SIZE,
583+
sizeof(*nfsd_file_hashtbl)), GFP_KERNEL);
584584
if (!nfsd_file_hashtbl) {
585585
pr_err("nfsd: unable to allocate nfsd_file_hashtbl\n");
586586
goto out_err;
@@ -646,7 +646,7 @@ nfsd_file_cache_init(void)
646646
nfsd_file_slab = NULL;
647647
kmem_cache_destroy(nfsd_file_mark_slab);
648648
nfsd_file_mark_slab = NULL;
649-
kfree(nfsd_file_hashtbl);
649+
kvfree(nfsd_file_hashtbl);
650650
nfsd_file_hashtbl = NULL;
651651
goto out;
652652
}
@@ -710,7 +710,7 @@ nfsd_file_cache_shutdown(void)
710710
fsnotify_wait_marks_destroyed();
711711
kmem_cache_destroy(nfsd_file_mark_slab);
712712
nfsd_file_mark_slab = NULL;
713-
kfree(nfsd_file_hashtbl);
713+
kvfree(nfsd_file_hashtbl);
714714
nfsd_file_hashtbl = NULL;
715715
}
716716

0 commit comments

Comments
 (0)