summarylogtreecommitdiffstats
path: root/0001-Linux-3.13-Check-return-value-from-bdi_init.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-Linux-3.13-Check-return-value-from-bdi_init.patch')
-rw-r--r--0001-Linux-3.13-Check-return-value-from-bdi_init.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/0001-Linux-3.13-Check-return-value-from-bdi_init.patch b/0001-Linux-3.13-Check-return-value-from-bdi_init.patch
new file mode 100644
index 00000000000..b0fb3cf90a3
--- /dev/null
+++ b/0001-Linux-3.13-Check-return-value-from-bdi_init.patch
@@ -0,0 +1,66 @@
+From 87377a9547443ae41aa6e393129389a765573aa3 Mon Sep 17 00:00:00 2001
+From: Marc Dionne <marc.dionne@your-file-system.com>
+Date: Tue, 3 Dec 2013 14:10:00 -0500
+Subject: [PATCH 1/5] Linux 3.13: Check return value from bdi_init
+
+The use of the bdi_init function now gets a warning because the
+return value is unused and the function is now defined with
+the warn_unused_result attribute.
+
+Assign and check the return value.
+
+Reviewed-on: http://gerrit.openafs.org/10530
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
+(cherry picked from commit ccc5d3f7adceda4d8cf41f04fe02d5cfe376befd)
+
+Change-Id: I2ccd9bbdce396a003030e3e09f9f6d75a1c4fa7c
+---
+ src/afs/LINUX/osi_vfsops.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c
+index 3936d4d..c222668 100644
+--- a/src/afs/LINUX/osi_vfsops.c
++++ b/src/afs/LINUX/osi_vfsops.c
+@@ -87,6 +87,9 @@ int
+ afs_fill_super(struct super_block *sb, void *data, int silent)
+ {
+ int code = 0;
++#if defined(HAVE_LINUX_BDI_INIT)
++ int bdi_init_done = 0;
++#endif
+
+ AFS_GLOCK();
+ if (afs_was_mounted) {
+@@ -115,7 +118,10 @@ afs_fill_super(struct super_block *sb, void *data, int silent)
+ afs_backing_dev_info = kmalloc(sizeof(struct backing_dev_info), GFP_NOFS);
+ memset(afs_backing_dev_info, 0, sizeof(struct backing_dev_info));
+ #if defined(HAVE_LINUX_BDI_INIT)
+- bdi_init(afs_backing_dev_info);
++ code = bdi_init(afs_backing_dev_info);
++ if (code)
++ goto out;
++ bdi_init_done = 1;
+ #endif
+ #if defined(STRUCT_BACKING_DEV_INFO_HAS_NAME)
+ afs_backing_dev_info->name = "openafs";
+@@ -144,11 +150,13 @@ afs_fill_super(struct super_block *sb, void *data, int silent)
+ #endif
+ #endif
+ code = afs_root(sb);
++out:
+ if (code) {
+ afs_globalVFS = NULL;
+ afs_FlushAllVCaches();
+ #if defined(HAVE_LINUX_BDI_INIT)
+- bdi_destroy(afs_backing_dev_info);
++ if (bdi_init_done)
++ bdi_destroy(afs_backing_dev_info);
+ #endif
+ kfree(afs_backing_dev_info);
+ module_put(THIS_MODULE);
+--
+2.8.2
+