Skip to content

Commit

Permalink
Remove iov_iter_advance() from iter_read
Browse files Browse the repository at this point in the history
There's no need to call iov_iter_advance() in zpl_iter_read().
This was preserved from the previous code where it wasn't needed
but also didn't cause any problems.  Now that the iter functions
also handle pipes that's no longer the case.  When fully reading a
pipe buffer iov_iter_advance() may results in the pipe buf release
function being called which will not be registered resulting in
a NULL dereference.

Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#11375 
Closes openzfs#11378
  • Loading branch information
behlendorf authored and jsai20 committed Mar 30, 2021
1 parent 6276046 commit 1e1936e
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions module/os/linux/zfs/zpl_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,6 @@ zpl_iter_read(struct kiocb *kiocb, struct iov_iter *to)

zpl_file_accessed(filp);

if (read > 0)
iov_iter_advance(to, read);

return (read);
}

Expand Down

0 comments on commit 1e1936e

Please sign in to comment.