提交 6b775b18 编写于 作者: A Al Viro

fuse: ->direct_IO() doesn't need generic_write_checks()

already done by caller.  We used to call __fuse_direct_write(), which
called generic_write_checks(); now the former got expanded, bringing
the latter to the surface.  It used to be called all along and calling
it from there had been wrong all along...
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 e768d7ff
...@@ -2806,8 +2806,8 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) ...@@ -2806,8 +2806,8 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
if (async_dio && iov_iter_rw(iter) != WRITE && offset + count > i_size) { if (async_dio && iov_iter_rw(iter) != WRITE && offset + count > i_size) {
if (offset >= i_size) if (offset >= i_size)
return 0; return 0;
count = min_t(loff_t, count, fuse_round_up(i_size - offset)); iov_iter_truncate(iter, fuse_round_up(i_size - offset));
iov_iter_truncate(iter, count); count = iov_iter_count(iter);
} }
io = kmalloc(sizeof(struct fuse_io_priv), GFP_KERNEL); io = kmalloc(sizeof(struct fuse_io_priv), GFP_KERNEL);
...@@ -2841,12 +2841,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset) ...@@ -2841,12 +2841,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
io->done = &wait; io->done = &wait;
if (iov_iter_rw(iter) == WRITE) { if (iov_iter_rw(iter) == WRITE) {
ret = generic_write_checks(file, &pos, &count); ret = fuse_direct_io(io, iter, &pos, FUSE_DIO_WRITE);
if (!ret) {
iov_iter_truncate(iter, count);
ret = fuse_direct_io(io, iter, &pos, FUSE_DIO_WRITE);
}
fuse_invalidate_attr(inode); fuse_invalidate_attr(inode);
} else { } else {
ret = __fuse_direct_read(io, iter, &pos); ret = __fuse_direct_read(io, iter, &pos);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册