aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorFang Wenqi <anton.fang@gmail.com>2009-12-30 05:37:13 -0500
committerMiklos Szeredi <mszeredi@suse.cz>2010-02-05 06:08:31 -0500
commitb2d82ee3c8b2193ee5bc7eca4687ee9be30abd34 (patch)
tree41986357886eda7e8e92c33ed32a743afee3f3e6 /fs/fuse
parentb21dda438baa450a76a375a35653ae0377793fab (diff)
fuse: fix large stack use
gcc 4.4 warns about: fs/fuse/dev.c: In function ‘fuse_notify_inval_entry’: fs/fuse/dev.c:925: warning: the frame size of 1060 bytes is larger than 1024 bytes The problem is we declare two structures and a large array on the stack, I move the array alway from the stack and allocate memory for it dynamically. Signed-off-by: Fang Wenqi <antonf@turbolinux.com.cn> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/dev.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index ab622305c2f5..eb7e9423691f 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -881,10 +881,15 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size,
881 struct fuse_copy_state *cs) 881 struct fuse_copy_state *cs)
882{ 882{
883 struct fuse_notify_inval_entry_out outarg; 883 struct fuse_notify_inval_entry_out outarg;
884 int err = -EINVAL; 884 int err = -ENOMEM;
885 char buf[FUSE_NAME_MAX+1]; 885 char *buf;
886 struct qstr name; 886 struct qstr name;
887 887
888 buf = kzalloc(FUSE_NAME_MAX + 1, GFP_KERNEL);
889 if (!buf)
890 goto err;
891
892 err = -EINVAL;
888 if (size < sizeof(outarg)) 893 if (size < sizeof(outarg))
889 goto err; 894 goto err;
890 895
@@ -910,9 +915,11 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size,
910 if (fc->sb) 915 if (fc->sb)
911 err = fuse_reverse_inval_entry(fc->sb, outarg.parent, &name); 916 err = fuse_reverse_inval_entry(fc->sb, outarg.parent, &name);
912 up_read(&fc->killsb); 917 up_read(&fc->killsb);
918 kfree(buf);
913 return err; 919 return err;
914 920
915err: 921err:
922 kfree(buf);
916 fuse_copy_finish(cs); 923 fuse_copy_finish(cs);
917 return err; 924 return err;
918} 925}