Linux: make sure backing_dev_info is zeroed

The afs backing_dev_info structure is allocated dynamically with
kmalloc, which doesn't zero out the contents.  In particular
there's no guarantee that congested_fn is NULL, causing spurious
oopses when bdi_congested tries to call it.

Change-Id: Ieeed870905627a132a0d1bd2f15cf80443b36303
Reviewed-on: http://gerrit.openafs.org/5334
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Marc Dionne 2011-09-03 12:32:33 -04:00 committed by Derrick Brashear
parent cbaefa266d
commit 8e97cf6f21

View File

@ -113,7 +113,7 @@ afs_fill_super(struct super_block *sb, void *data, int silent)
#endif
/* used for inodes backing_dev_info field, also */
afs_backing_dev_info = kmalloc(sizeof(struct backing_dev_info), GFP_NOFS);
afs_backing_dev_info = kzalloc(sizeof(struct backing_dev_info), GFP_NOFS);
#if defined(HAVE_LINUX_BDI_INIT)
bdi_init(afs_backing_dev_info);
#endif