From: Marc Dionne Date: Sat, 3 Sep 2011 16:32:33 +0000 (-0400) Subject: Linux: make sure backing_dev_info is zeroed X-Git-Tag: upstream/1.8.0_pre1^2~3329 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8e97cf6f215d5575c63d86eaec59031399f4beda;p=packages%2Fo%2Fopenafs.git 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 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index 4495300d9..879627634 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -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