From 3b2713bb230c4b48efe68bc1265e06c3bec352b0 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Sat, 19 Dec 2020 10:07:18 -0800 Subject: [PATCH] Remove iov_iter_advance() from iter_read 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. 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 --- module/os/linux/zfs/zpl_file.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/module/os/linux/zfs/zpl_file.c b/module/os/linux/zfs/zpl_file.c index d6bc84009e21..6e1b182eb686 100644 --- a/module/os/linux/zfs/zpl_file.c +++ b/module/os/linux/zfs/zpl_file.c @@ -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); }