Whamcloud - gitweb
LU-5066 build: fix compile issues with newer gcc 78/9678/4
authorJames Simmons <uja.ornl@gmail.com>
Fri, 16 May 2014 13:41:14 +0000 (09:41 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 27 May 2014 18:42:43 +0000 (18:42 +0000)
Fixed the error: 'name' may be used uninitialized in
the osd_compact code. Also added padding to struct
shrinker for the posix layer otherwise gcc complies
it away and we end up with a build failure.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I164957525d572d9d7a58196e5b38fb1349745d44
Reviewed-on: http://review.whamcloud.com/9678
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/include/libcfs/posix/libcfs.h
lustre/osd-ldiskfs/osd_compat.c

index e6d91bc..ce16a36 100644 (file)
@@ -273,7 +273,9 @@ static inline int module_refcount(struct module *m)
  ***************************************************************************/
 
 struct shrinker {
-        ;
+       /* Need padding due to certain versions of gcc (4.3) which will not
+        * build with an empty structure. */
+       int pad;
 };
 
 #define DEFAULT_SEEKS (0)
index 8e7fc11..bdd7c6a 100644 (file)
@@ -1164,7 +1164,7 @@ unlock:
 }
 
 static struct dentry *
-osd_object_spec_find(struct osd_thread_info *info, struct osd_device *osd,
+osd_obj_spec_find(struct osd_thread_info *info, struct osd_device *osd,
                     const struct lu_fid *fid, char **name)
 {
        struct dentry *root = ERR_PTR(-ENOENT);
@@ -1195,11 +1195,11 @@ int osd_obj_spec_update(struct osd_thread_info *info, struct osd_device *osd,
                        struct thandle *th)
 {
        struct dentry   *root;
-       char            *name;
+       char            *name = NULL;
        int              rc;
        ENTRY;
 
-       root = osd_object_spec_find(info, osd, fid, &name);
+       root = osd_obj_spec_find(info, osd, fid, &name);
        if (!IS_ERR(root)) {
                rc = osd_obj_update_entry(info, osd, root, name, fid, id, th);
        } else {
@@ -1220,7 +1220,7 @@ int osd_obj_spec_insert(struct osd_thread_info *info, struct osd_device *osd,
        int              rc;
        ENTRY;
 
-       root = osd_object_spec_find(info, osd, fid, &name);
+       root = osd_obj_spec_find(info, osd, fid, &name);
        if (!IS_ERR(root)) {
                rc = osd_obj_add_entry(info, osd, root, name, id, th);
        } else {
@@ -1238,7 +1238,7 @@ int osd_obj_spec_lookup(struct osd_thread_info *info, struct osd_device *osd,
        struct dentry   *root;
        struct dentry   *dentry;
        struct inode    *inode;
-       char            *name;
+       char            *name = NULL;
        int             rc = -ENOENT;
        ENTRY;