Hi Greg,
in my filesystem set_fs removel series I convert the seq_file interface
to be iov_iter based. It turns out debugfs needs this little patch
to proxy read_iter as well. Let me know if you are ok with me queueing
this up with the rest of the series.
debugfs registrations typically go through a set of proxy ops to deal
with refcounting, which need to support every method that can be
supported. Add ->read_iter to the proxy ops to prepare for seq_file to
be switch to ->read_iter.
Reported-by: Jon Hunter <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
---
fs/debugfs/file.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index 8ba32c2feb1b73..dcd7bdaf67417f 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -231,6 +231,10 @@ FULL_PROXY_FUNC(read, ssize_t, filp,
loff_t *ppos),
ARGS(filp, buf, size, ppos));
+FULL_PROXY_FUNC(read_iter, ssize_t, iocb->ki_filp,
+ PROTO(struct kiocb *iocb, struct iov_iter *iter),
+ ARGS(iocb, iter));
+
FULL_PROXY_FUNC(write, ssize_t, filp,
PROTO(struct file *filp, const char __user *buf, size_t size,
loff_t *ppos),
@@ -286,6 +290,8 @@ static void __full_proxy_fops_init(struct file_operations *proxy_fops,
proxy_fops->llseek = full_proxy_llseek;
if (real_fops->read)
proxy_fops->read = full_proxy_read;
+ if (real_fops->read_iter)
+ proxy_fops->read_iter = full_proxy_read_iter;
if (real_fops->write)
proxy_fops->write = full_proxy_write;
if (real_fops->poll)
--
2.26.2
On Mon, Jul 13, 2020 at 09:37:29AM +0200, Christoph Hellwig wrote:
> debugfs registrations typically go through a set of proxy ops to deal
> with refcounting, which need to support every method that can be
> supported. Add ->read_iter to the proxy ops to prepare for seq_file to
> be switch to ->read_iter.
>
> Reported-by: Jon Hunter <[email protected]>
> Signed-off-by: Christoph Hellwig <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
On Mon, Jul 13, 2020 at 09:37:28AM +0200, Christoph Hellwig wrote:
> Hi Greg,
>
> in my filesystem set_fs removel series I convert the seq_file interface
> to be iov_iter based. It turns out debugfs needs this little patch
> to proxy read_iter as well. Let me know if you are ok with me queueing
> this up with the rest of the series.
>
>
No objection from me, please do so!
thanks,
greg k-h
On 13/07/2020 09:38, Greg KH wrote:
> On Mon, Jul 13, 2020 at 09:37:29AM +0200, Christoph Hellwig wrote:
>> debugfs registrations typically go through a set of proxy ops to deal
>> with refcounting, which need to support every method that can be
>> supported. Add ->read_iter to the proxy ops to prepare for seq_file to
>> be switch to ->read_iter.
>>
>> Reported-by: Jon Hunter <[email protected]>
>> Signed-off-by: Christoph Hellwig <[email protected]>
>
> Acked-by: Greg Kroah-Hartman <[email protected]>
>
Tested-by: Jon Hunter <[email protected]>
Cheers
Jon
--
nvpublic