Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix batch forget can't handle too large msg
error: cannot process fuse message: Value too large for defined data type By default, when fuse sever reads the batch forget request, the bufsize given is MAX_BUFFER_SIZE + BUFFER_HEADER_SIZE, and the fuse kernel will fill this buffer as much as possible, so the size of the data that batch forget can fill should be the total buffer size - fuse header - batch forget header Here's the code for the fuse kernel to fill the batch forget request. ``` struct fuse_batch_forget_in arg = { .count = 0 }; struct fuse_in_header ih = { .opcode = FUSE_BATCH_FORGET, .unique = fuse_get_unique(fiq), .len = sizeof(ih) + sizeof(arg), }; if (nbytes < ih.len) { spin_unlock(&fiq->lock); return -EINVAL; } max_forgets = (nbytes - ih.len) / sizeof(struct fuse_forget_one); head = fuse_dequeue_forget(fiq, max_forgets, &count); spin_unlock(&fiq->lock); arg.count = count; ih.len += count * sizeof(struct fuse_forget_one); ``` so fuse_batch_forget_in.count * sizeof(struct fuse_forget_one) should less than or equal to bufsize - sizeof(fuse_in_header) - sizeof(fuse_batch_forget_in) Signed-off-by: zyfjeff <[email protected]>
- Loading branch information