On Tue, Nov 21, 2023 at 5:28 PM Christian Brauner <brauner@xxxxxxxxxx> wrote: > > > +ssize_t vfs_iocb_iter_read(struct file *file, struct kiocb *iocb, > > + struct iov_iter *iter) > > Fyi, vfs_iocb_iter_read() and vfs_iter_read() end up with the same checks: > > if (!file->f_op->read_iter) > return -EINVAL; > if (!(file->f_mode & FMODE_READ)) > return -EBADF; > if (!(file->f_mode & FMODE_CAN_READ)) > return -EINVAL; > > tot_len = iov_iter_count(iter); > if (!tot_len) > goto out; > ret = rw_verify_area(READ, file, &iocb->ki_pos, tot_len); > if (ret < 0) > return ret; > > So if you resend you might want to static inline this. But idk, might > not matter too much. There are more commonalities with other helpers, but I don't want to "over clean", so I'd rather leave it like that. I will remove the else in do_iter_read(). Thanks, Amir.