diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2008-04-30 00:54:44 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 08:29:51 -0700 |
commit | e5d9a0df07484d6d191756878c974e4307fb24ce (patch) | |
tree | b3117ed75242e523dd7c2ff9fc0878b78c7fcb0c /fs/fuse/inode.c | |
parent | 5c5c5e51b26413d50a9efae2ca7d6c5c6cd453ac (diff) | |
download | linux-e5d9a0df07484d6d191756878c974e4307fb24ce.tar.bz2 |
fuse: fix max i/o size calculation
Fix a bug that Werner Baumann reported: fuse can send a bigger write request
than the maximum specified. This only affected direct_io operation.
In addition set a sane minimum for the max_read and max_write tunables, so I/O
always makes some progress.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r-- | fs/fuse/inode.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 7d01c68852a8..0cef5ea319f3 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -584,6 +584,7 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req) fc->bdi.ra_pages = min(fc->bdi.ra_pages, ra_pages); fc->minor = arg->minor; fc->max_write = arg->minor < 5 ? 4096 : arg->max_write; + fc->max_write = min_t(unsigned, 4096, fc->max_write); fc->conn_init = 1; } fuse_put_request(fc, req); @@ -658,7 +659,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) fc->flags = d.flags; fc->user_id = d.user_id; fc->group_id = d.group_id; - fc->max_read = d.max_read; + fc->max_read = min_t(unsigned, 4096, d.max_read); /* Used by get_root_inode() */ sb->s_fs_info = fc; |