aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r--fs/fuse/inode.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index e69a546844d0..04c80cc957a3 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -135,12 +135,8 @@ static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr)
135 fuse_init_common(inode); 135 fuse_init_common(inode);
136 init_special_inode(inode, inode->i_mode, 136 init_special_inode(inode, inode->i_mode,
137 new_decode_dev(attr->rdev)); 137 new_decode_dev(attr->rdev));
138 } else { 138 } else
139 /* Don't let user create weird files */ 139 BUG();
140 inode->i_mode = S_IFREG;
141 fuse_init_common(inode);
142 fuse_init_file_inode(inode);
143 }
144} 140}
145 141
146static int fuse_inode_eq(struct inode *inode, void *_nodeidp) 142static int fuse_inode_eq(struct inode *inode, void *_nodeidp)
@@ -218,6 +214,7 @@ static void convert_fuse_statfs(struct kstatfs *stbuf, struct fuse_kstatfs *attr
218{ 214{
219 stbuf->f_type = FUSE_SUPER_MAGIC; 215 stbuf->f_type = FUSE_SUPER_MAGIC;
220 stbuf->f_bsize = attr->bsize; 216 stbuf->f_bsize = attr->bsize;
217 stbuf->f_frsize = attr->frsize;
221 stbuf->f_blocks = attr->blocks; 218 stbuf->f_blocks = attr->blocks;
222 stbuf->f_bfree = attr->bfree; 219 stbuf->f_bfree = attr->bfree;
223 stbuf->f_bavail = attr->bavail; 220 stbuf->f_bavail = attr->bavail;
@@ -238,10 +235,12 @@ static int fuse_statfs(struct super_block *sb, struct kstatfs *buf)
238 if (!req) 235 if (!req)
239 return -EINTR; 236 return -EINTR;
240 237
238 memset(&outarg, 0, sizeof(outarg));
241 req->in.numargs = 0; 239 req->in.numargs = 0;
242 req->in.h.opcode = FUSE_STATFS; 240 req->in.h.opcode = FUSE_STATFS;
243 req->out.numargs = 1; 241 req->out.numargs = 1;
244 req->out.args[0].size = sizeof(outarg); 242 req->out.args[0].size =
243 fc->minor < 4 ? FUSE_COMPAT_STATFS_SIZE : sizeof(outarg);
245 req->out.args[0].value = &outarg; 244 req->out.args[0].value = &outarg;
246 request_send(fc, req); 245 request_send(fc, req);
247 err = req->out.h.error; 246 err = req->out.h.error;
@@ -482,7 +481,6 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
482 fc->max_read = d.max_read; 481 fc->max_read = d.max_read;
483 if (fc->max_read / PAGE_CACHE_SIZE < fc->bdi.ra_pages) 482 if (fc->max_read / PAGE_CACHE_SIZE < fc->bdi.ra_pages)
484 fc->bdi.ra_pages = fc->max_read / PAGE_CACHE_SIZE; 483 fc->bdi.ra_pages = fc->max_read / PAGE_CACHE_SIZE;
485 fc->max_write = FUSE_MAX_IN / 2;
486 484
487 err = -ENOMEM; 485 err = -ENOMEM;
488 root = get_root_inode(sb, d.rootmode); 486 root = get_root_inode(sb, d.rootmode);