Linux: make sure backing_dev_info is zeroed
authorMarc Dionne <marc.c.dionne@gmail.com>
Sat, 3 Sep 2011 16:32:33 +0000 (12:32 -0400)
committerDerrick Brashear <shadow@dementix.org>
Mon, 5 Sep 2011 13:04:19 +0000 (06:04 -0700)
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>

src/afs/LINUX/osi_vfsops.c

index 4495300..8796276 100644 (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