]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
fuse: fix thinko in max I/O size calucation
authorMiklos Szeredi <mszeredi@suse.cz>
Tue, 17 Jun 2008 16:05:40 +0000 (18:05 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 Jun 2008 01:08:10 +0000 (18:08 -0700)
Use max not min to enforce a lower limit on the max I/O size.

This bug was introduced by "fuse: fix max i/o size calculation" (commit
e5d9a0df07484d6d191756878c974e4307fb24ce).

Thanks to Brian Wang for noticing.

Reported-by: Brian Wang <ywang221@hotmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Acked-by: Szabolcs Szakacsits <szaka@ntfs-3g.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/fuse/inode.c

index 43e99513334ae1a11c95d9428282d0541715e8ae..3141690558c8aa6029128f7c2d8a5b9fc742696d 100644 (file)
@@ -591,7 +591,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->max_write = max_t(unsigned, 4096, fc->max_write);
                fc->conn_init = 1;
        }
        fuse_put_request(fc, req);
@@ -667,7 +667,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 = min_t(unsigned, 4096, d.max_read);
+       fc->max_read = max_t(unsigned, 4096, d.max_read);
 
        /* Used by get_root_inode() */
        sb->s_fs_info = fc;