Skip to content

Commit f948d56

Browse files
Miklos Szereditorvalds
authored andcommitted
fuse: fix thinko in max I/O size calucation
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 e5d9a0d). Thanks to Brian Wang for noticing. Reported-by: Brian Wang <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]> Acked-by: Szabolcs Szakacsits <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent cd50e89 commit f948d56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/fuse/inode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
591591
fc->bdi.ra_pages = min(fc->bdi.ra_pages, ra_pages);
592592
fc->minor = arg->minor;
593593
fc->max_write = arg->minor < 5 ? 4096 : arg->max_write;
594-
fc->max_write = min_t(unsigned, 4096, fc->max_write);
594+
fc->max_write = max_t(unsigned, 4096, fc->max_write);
595595
fc->conn_init = 1;
596596
}
597597
fuse_put_request(fc, req);
@@ -667,7 +667,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
667667
fc->flags = d.flags;
668668
fc->user_id = d.user_id;
669669
fc->group_id = d.group_id;
670-
fc->max_read = min_t(unsigned, 4096, d.max_read);
670+
fc->max_read = max_t(unsigned, 4096, d.max_read);
671671

672672
/* Used by get_root_inode() */
673673
sb->s_fs_info = fc;

0 commit comments

Comments
 (0)