Re: [PATCH v3 2/3] ceph: Make ceph_netfs_issue_op() handle inlined data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2022-01-21 at 14:57 +0000, David Howells wrote:
> Jeff Layton <jlayton@xxxxxxxxxx> wrote:
> 
> > +	len = iinfo->inline_len;
> > +	iov_iter_xarray(&iter, READ, &rreq->mapping->i_pages, subreq->start, len);
> > +	err = copy_to_iter(iinfo->inline_data, len, &iter);
> 
> I think this is probably wrong.  It will read the entirety of the inline data
> into the buffer, even if it's bigger than the buffer and you need to offset
> pointer into the buffer.
> 
> You need to limit it to subreq->len.  Maybe:
> 
> 	len = min_t(size_t, iinfo->inline_len - subreq->start, subreq->len);
> 	iov_iter_xarray(&iter, READ, &rreq->mapping->i_pages,
> 			subreq->start, len);
> 	err = copy_to_iter(iinfo->inline_data + subreq->start, len, &iter);
> 
> David
> 

Good point. I'll make that change and re-test, but it makes sense.
-- 
Jeff Layton <jlayton@xxxxxxxxxx>



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux