All of lore.kernel.org
 help / color / mirror / Atom feed
* allow ->read_iter on debugfs
@ 2020-07-13  7:37 Christoph Hellwig
  2020-07-13  7:37 ` [PATCH] debugfs: add a proxy stub for ->read_iter Christoph Hellwig
  2020-07-13  8:38 ` allow ->read_iter on debugfs Greg KH
  0 siblings, 2 replies; 5+ messages in thread
From: Christoph Hellwig @ 2020-07-13  7:37 UTC (permalink / raw)
  To: gregkh, rafael; +Cc: linux-kernel

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.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] debugfs: add a proxy stub for ->read_iter
  2020-07-13  7:37 allow ->read_iter on debugfs Christoph Hellwig
@ 2020-07-13  7:37 ` Christoph Hellwig
  2020-07-13  8:38   ` Greg KH
  2020-07-13  8:38 ` allow ->read_iter on debugfs Greg KH
  1 sibling, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2020-07-13  7:37 UTC (permalink / raw)
  To: gregkh, rafael; +Cc: linux-kernel, Jon Hunter

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 <jonathanh@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] debugfs: add a proxy stub for ->read_iter
  2020-07-13  7:37 ` [PATCH] debugfs: add a proxy stub for ->read_iter Christoph Hellwig
@ 2020-07-13  8:38   ` Greg KH
  2020-07-13 18:13     ` Jon Hunter
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2020-07-13  8:38 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: rafael, linux-kernel, Jon Hunter

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 <jonathanh@nvidia.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: allow ->read_iter on debugfs
  2020-07-13  7:37 allow ->read_iter on debugfs Christoph Hellwig
  2020-07-13  7:37 ` [PATCH] debugfs: add a proxy stub for ->read_iter Christoph Hellwig
@ 2020-07-13  8:38 ` Greg KH
  1 sibling, 0 replies; 5+ messages in thread
From: Greg KH @ 2020-07-13  8:38 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: rafael, linux-kernel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] debugfs: add a proxy stub for ->read_iter
  2020-07-13  8:38   ` Greg KH
@ 2020-07-13 18:13     ` Jon Hunter
  0 siblings, 0 replies; 5+ messages in thread
From: Jon Hunter @ 2020-07-13 18:13 UTC (permalink / raw)
  To: Greg KH, Christoph Hellwig; +Cc: rafael, linux-kernel


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 <jonathanh@nvidia.com>
>> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 


Tested-by: Jon Hunter <jonathanh@nvidia.com>

Cheers
Jon

-- 
nvpublic


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-13 18:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-13  7:37 allow ->read_iter on debugfs Christoph Hellwig
2020-07-13  7:37 ` [PATCH] debugfs: add a proxy stub for ->read_iter Christoph Hellwig
2020-07-13  8:38   ` Greg KH
2020-07-13 18:13     ` Jon Hunter
2020-07-13  8:38 ` allow ->read_iter on debugfs Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.