Commit 8563000d authored by Zheng Liu's avatar Zheng Liu Committed by Theodore Ts'o

ext4: use consistent ssize_t type in ext4_file_write()

The generic_file_aio_write() function returns ssize_t, and
ext4_file_write() returns a ssize_t, so use a ssize_t to collect the
return value from generic_file_aio_write().  It shouldn't matter since
the VFS read/write paths shouldn't allow a read greater than MAX_INT,
but there was previously a bug in the AIO code paths, and it's best if
we use a consistent type so that the return value from
generic_file_aio_write() can't get truncated.
Reported-by: default avatarJouni Siren <jouni.siren@iki.fi>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarZheng Liu <wenqing.lz@taobao.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 4a3c3a51
...@@ -95,7 +95,7 @@ ext4_file_write(struct kiocb *iocb, const struct iovec *iov, ...@@ -95,7 +95,7 @@ ext4_file_write(struct kiocb *iocb, const struct iovec *iov,
{ {
struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode;
int unaligned_aio = 0; int unaligned_aio = 0;
int ret; ssize_t ret;
/* /*
* If we have encountered a bitmap-format file, the size limit * If we have encountered a bitmap-format file, the size limit
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment