Re: [PATCH v3 8/8] iomap: Copy larger chunks from userspace

Matthew Wilcox
2023-06-19T17:10:09Z

On Sat, Jun 17, 2023 at 12:43:59PM +0530, Ritesh Harjani wrote:
> > do {
> > struct folio *folio;
> > - struct page *page;
> > - unsigned long offset; /* Offset into pagecache page */
> > - unsigned long bytes; /* Bytes to write to page */
> > + size_t offset; /* Offset into folio */
> > + unsigned long bytes; /* Bytes to write to folio */
>
> why not keep typeof "bytes" as size_t same as of "copied".

Sure, makes sense.

> > @@ -835,6 +837,8 @@ static loff_t iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i)
> > */
> > if (copied)
> > bytes = copied;
>
> I think with your code change which changes the label position of
> "again", the above lines doing bytes = copied becomes dead code.
> We anyway recalculate bytes after "again" label.

Yes, you're right. Removed. I had a good think about whether this
forgotten removal meant an overlooked problem, but I can't see one.