diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 2cec25ad54b7..4404d21649ff 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -826,9 +826,12 @@ static const struct super_operations fuse_super_operations = { static void sanitize_global_limit(unsigned *limit) { + /* + * The default maximum number of async requests is calculated to consume + * 1/2^13 of the total memory, assuming 392 bytes per request. + */ if (*limit == 0) - *limit = ((totalram_pages() << PAGE_SHIFT) >> 13) / - sizeof(struct fuse_req); + *limit = ((totalram_pages() << PAGE_SHIFT) >> 13) / 392; if (*limit >= 1 << 16) *limit = (1 << 16) - 1;