Unionfs: Don't inline do_remount_{add,del,mode}_option
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 23 Mar 2007 17:10:46 +0000 (13:10 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 11 Nov 2014 02:31:44 +0000 (21:31 -0500)
gcc4 decided to inline do_remount_{add,del,mode}_option creating an 600 byte
stack abuser on a x86_64 test box.

Reported by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
fs/unionfs/lookup.c
fs/unionfs/super.c

index 0572247092ce1a5a26bce4c16bf028f32efcfb40..0fc5993290118ce3ce8a82a4bb22fc6fc874b90d 100644 (file)
@@ -30,7 +30,7 @@ static int is_validname(const char *name)
 }
 
 /* The rest of these are utility functions for lookup. */
-static int is_opaque_dir(struct dentry *dentry, int bindex)
+static noinline int is_opaque_dir(struct dentry *dentry, int bindex)
 {
        int err = 0;
        struct dentry *hidden_dentry;
index ec5706b115f1d548aab36ea4c142c4276356e9e5..e6a6cc1891150ba2dc8a2d5ac4cc9676f36194a7 100644 (file)
@@ -148,9 +148,9 @@ static int unionfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 }
 
 /* handle mode changing during remount */
-static int do_remount_mode_option(char *optarg, int cur_branches,
-                                 struct unionfs_data *new_data,
-                                 struct path *new_lower_paths)
+static noinline int do_remount_mode_option(char *optarg, int cur_branches,
+                                          struct unionfs_data *new_data,
+                                          struct path *new_lower_paths)
 {
        int err = -EINVAL;
        int perms, idx;
@@ -207,9 +207,9 @@ out:
 }
 
 /* handle branch deletion during remount */
-static int do_remount_del_option(char *optarg, int cur_branches,
-                                struct unionfs_data *new_data,
-                                struct path *new_lower_paths)
+static noinline int do_remount_del_option(char *optarg, int cur_branches,
+                                         struct unionfs_data *new_data,
+                                         struct path *new_lower_paths)
 {
        int err = -EINVAL;
        int idx;
@@ -268,10 +268,10 @@ out:
 }
 
 /* handle branch insertion during remount */
-static int do_remount_add_option(char *optarg, int cur_branches,
-                                struct unionfs_data *new_data,
-                                struct path *new_lower_paths,
-                                int *high_branch_id)
+static noinline int do_remount_add_option(char *optarg, int cur_branches,
+                                         struct unionfs_data *new_data,
+                                         struct path *new_lower_paths,
+                                         int *high_branch_id)
 {
        int err = -EINVAL;
        int perms;