If user updates conn->max_write in fuse_lowlevel_ops' init() method, do_init()
will miss the "conn.max_write > bufsize - FUSE_BUFFER_HEADER_SIZE" judgment,
and ->init method will be called after it, which obviously is a bug.
Signed-off-by: Xiaoguang Wang <lege.wang@jaguarmicro.com>
Co-authored-by: Xiaoguang Wang <lege.wang@jaguarmicro.com>
}
se->bufsize = bufsize;
- if (se->conn.max_write > bufsize - FUSE_BUFFER_HEADER_SIZE)
- se->conn.max_write = bufsize - FUSE_BUFFER_HEADER_SIZE;
-
se->got_init = 1;
if (se->op.init)
se->op.init(se->userdata, &se->conn);
+ if (se->conn.max_write > bufsize - FUSE_BUFFER_HEADER_SIZE)
+ se->conn.max_write = bufsize - FUSE_BUFFER_HEADER_SIZE;
+
if (se->conn.want & (~se->conn.capable)) {
fuse_log(FUSE_LOG_ERR, "fuse: error: filesystem requested capabilities "
"0x%x that are not supported by kernel, aborting.\n",