Skip to content

Commit

Permalink
fuse: ->direct_IO() doesn't need generic_write_checks()
Browse files Browse the repository at this point in the history
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: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Apr 12, 2015
1 parent e768d7f commit 6b775b1
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 (offset >= i_size)
return 0;
count = min_t(loff_t, count, fuse_round_up(i_size - offset));
iov_iter_truncate(iter, count);
iov_iter_truncate(iter, fuse_round_up(i_size - offset));
count = iov_iter_count(iter);
}

io = kmalloc(sizeof(struct fuse_io_priv), GFP_KERNEL);
Expand Down Expand Up @@ -2841,12 +2841,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter, loff_t offset)
io->done = &wait;

if (iov_iter_rw(iter) == WRITE) {
ret = generic_write_checks(file, &pos, &count);
if (!ret) {
iov_iter_truncate(iter, count);
ret = fuse_direct_io(io, iter, &pos, FUSE_DIO_WRITE);
}

ret = fuse_direct_io(io, iter, &pos, FUSE_DIO_WRITE);
fuse_invalidate_attr(inode);
} else {
ret = __fuse_direct_read(io, iter, &pos);
Expand Down

0 comments on commit 6b775b1

Please sign in to comment.