Re: [PATCH 6/9] debugfs: Implement debugfs_create_str()

2021-03-27 Thread Steven Rostedt
On Sat, 27 Mar 2021 22:24:45 + Al Viro wrote: > On Fri, Mar 26, 2021 at 11:33:58AM +0100, Peter Zijlstra wrote: > > > +again: > > + rcu_read_lock(); > > + str = rcu_dereference(*(char **)file->private_data); > > + len = strlen(str) + 1; > > + > > + if (!copy || copy_len < len) { > >

Re: [PATCH 6/9] debugfs: Implement debugfs_create_str()

2021-03-27 Thread Al Viro
On Fri, Mar 26, 2021 at 11:33:58AM +0100, Peter Zijlstra wrote: > +again: > + rcu_read_lock(); > + str = rcu_dereference(*(char **)file->private_data); > + len = strlen(str) + 1; > + > + if (!copy || copy_len < len) { > + rcu_read_unlock(); > + kfree(copy);

Re: [PATCH 6/9] debugfs: Implement debugfs_create_str()

2021-03-26 Thread Greg KH
On Fri, Mar 26, 2021 at 12:18:47PM +0100, Peter Zijlstra wrote: > On Fri, Mar 26, 2021 at 12:05:07PM +0100, Greg KH wrote: > > On Fri, Mar 26, 2021 at 11:33:58AM +0100, Peter Zijlstra wrote: > > > > > > Signed-off-by: Peter Zijlstra (Intel) > > > > No changelog text? :( > > Yeah, didn't

Re: [PATCH 6/9] debugfs: Implement debugfs_create_str()

2021-03-26 Thread Peter Zijlstra
On Fri, Mar 26, 2021 at 12:05:07PM +0100, Greg KH wrote: > On Fri, Mar 26, 2021 at 11:33:58AM +0100, Peter Zijlstra wrote: > > > > Signed-off-by: Peter Zijlstra (Intel) > > No changelog text? :( Yeah, didn't really know what to say that the Subject didn't already do. > > +/** > > + *

Re: [PATCH 6/9] debugfs: Implement debugfs_create_str()

2021-03-26 Thread Greg KH
On Fri, Mar 26, 2021 at 11:33:58AM +0100, Peter Zijlstra wrote: > > Signed-off-by: Peter Zijlstra (Intel) No changelog text? :( > +/** > + * debugfs_create_str - create a debugfs file that is used to read and write > a string value > + * @name: a pointer to a string containing the name of

[PATCH 6/9] debugfs: Implement debugfs_create_str()

2021-03-26 Thread Peter Zijlstra
Signed-off-by: Peter Zijlstra (Intel) --- fs/debugfs/file.c | 144 include/linux/debugfs.h | 29 + 2 files changed, 173 insertions(+) --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -865,6 +865,150 @@ struct dentry