2021-12-21 14:36:23

by CGEL

[permalink] [raw]
Subject: [PATCH] ceph: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

From: Changcheng Deng <[email protected]>

Fix the following coccicheck warning:
./fs/ceph/debugfs.c: 390: 0-23: WARNING: congestion_kb_fops should be
defined with DEFINE_DEBUGFS_ATTRIBUTE

Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for
debugfs files.

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: Changcheng Deng <[email protected]>
---
fs/ceph/debugfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
index 3cf7c9c1085b..64c4158c17c8 100644
--- a/fs/ceph/debugfs.c
+++ b/fs/ceph/debugfs.c
@@ -387,8 +387,8 @@ static int congestion_kb_get(void *data, u64 *val)
return 0;
}

-DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
- congestion_kb_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
+ congestion_kb_set, "%llu\n");


void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
--
2.25.1



2022-01-03 14:42:09

by Jeff Layton

[permalink] [raw]
Subject: Re: [PATCH] ceph: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

On Tue, 2021-12-21 at 14:36 +0000, [email protected] wrote:
> From: Changcheng Deng <[email protected]>
>
> Fix the following coccicheck warning:
> ./fs/ceph/debugfs.c: 390: 0-23: WARNING: congestion_kb_fops should be
> defined with DEFINE_DEBUGFS_ATTRIBUTE
>
> Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for
> debugfs files.
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: Changcheng Deng <[email protected]>
> ---
> fs/ceph/debugfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
> index 3cf7c9c1085b..64c4158c17c8 100644
> --- a/fs/ceph/debugfs.c
> +++ b/fs/ceph/debugfs.c
> @@ -387,8 +387,8 @@ static int congestion_kb_get(void *data, u64 *val)
> return 0;
> }
>
> -DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
> - congestion_kb_set, "%llu\n");
> +DEFINE_DEBUGFS_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
> + congestion_kb_set, "%llu\n");
>
>
> void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)

Thanks, merged into our testing branch. This should make v5.17.

Cheers,
--
Jeff Layton <[email protected]>

2022-01-03 15:03:37

by Ilya Dryomov

[permalink] [raw]
Subject: Re: [PATCH] ceph: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

On Mon, Jan 3, 2022 at 3:41 PM Jeff Layton <[email protected]> wrote:
>
> On Tue, 2021-12-21 at 14:36 +0000, [email protected] wrote:
> > From: Changcheng Deng <[email protected]>
> >
> > Fix the following coccicheck warning:
> > ./fs/ceph/debugfs.c: 390: 0-23: WARNING: congestion_kb_fops should be
> > defined with DEFINE_DEBUGFS_ATTRIBUTE
> >
> > Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for
> > debugfs files.
> >
> > Reported-by: Zeal Robot <[email protected]>
> > Signed-off-by: Changcheng Deng <[email protected]>
> > ---
> > fs/ceph/debugfs.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
> > index 3cf7c9c1085b..64c4158c17c8 100644
> > --- a/fs/ceph/debugfs.c
> > +++ b/fs/ceph/debugfs.c
> > @@ -387,8 +387,8 @@ static int congestion_kb_get(void *data, u64 *val)
> > return 0;
> > }
> >
> > -DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
> > - congestion_kb_set, "%llu\n");
> > +DEFINE_DEBUGFS_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
> > + congestion_kb_set, "%llu\n");
> >
> >
> > void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
>
> Thanks, merged into our testing branch. This should make v5.17.

Hi Jeff,

This came up last year, has anything changed?

https://www.spinics.net/lists/ceph-devel/msg50492.html

Thanks,

Ilya

2022-01-03 15:30:23

by Jeff Layton

[permalink] [raw]
Subject: Re: [PATCH] ceph: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

On Mon, 2022-01-03 at 16:03 +0100, Ilya Dryomov wrote:
> On Mon, Jan 3, 2022 at 3:41 PM Jeff Layton <[email protected]> wrote:
> >
> > On Tue, 2021-12-21 at 14:36 +0000, [email protected] wrote:
> > > From: Changcheng Deng <[email protected]>
> > >
> > > Fix the following coccicheck warning:
> > > ./fs/ceph/debugfs.c: 390: 0-23: WARNING: congestion_kb_fops should be
> > > defined with DEFINE_DEBUGFS_ATTRIBUTE
> > >
> > > Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for
> > > debugfs files.
> > >
> > > Reported-by: Zeal Robot <[email protected]>
> > > Signed-off-by: Changcheng Deng <[email protected]>
> > > ---
> > > fs/ceph/debugfs.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
> > > index 3cf7c9c1085b..64c4158c17c8 100644
> > > --- a/fs/ceph/debugfs.c
> > > +++ b/fs/ceph/debugfs.c
> > > @@ -387,8 +387,8 @@ static int congestion_kb_get(void *data, u64 *val)
> > > return 0;
> > > }
> > >
> > > -DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
> > > - congestion_kb_set, "%llu\n");
> > > +DEFINE_DEBUGFS_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
> > > + congestion_kb_set, "%llu\n");
> > >
> > >
> > > void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
> >
> > Thanks, merged into our testing branch. This should make v5.17.
>
> Hi Jeff,
>
> This came up last year, has anything changed?
>
> https://www.spinics.net/lists/ceph-devel/msg50492.html
>

Good point, that discussion had totally slipped my mind. Dropping this
patch again for now until the rationale is clearer.

Jiapeng, could you clarify why you didn't do the other part of that
conversion?

Thanks,
--
Jeff Layton <[email protected]>