2020-08-11 15:04:13

by Vladis Dronov

[permalink] [raw]
Subject: [PATCH] debugfs: Fix module state check condition

The '#ifdef MODULE' check in the original commit does not work as intended.
The code under the check is not built at all if CONFIG_DEBUG_FS=y. Fix this
by using a correct check.

Fixes: 275678e7a9be ("debugfs: Check module state before warning in {full/open}_proxy_open()")
Signed-off-by: Vladis Dronov <[email protected]>
---
fs/debugfs/file.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index b167d2d02148..a768a09430c3 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -177,7 +177,7 @@ static int open_proxy_open(struct inode *inode, struct file *filp)
goto out;

if (!fops_get(real_fops)) {
-#ifdef MODULE
+#ifdef CONFIG_MODULES
if (real_fops->owner &&
real_fops->owner->state == MODULE_STATE_GOING)
goto out;
@@ -312,7 +312,7 @@ static int full_proxy_open(struct inode *inode, struct file *filp)
goto out;

if (!fops_get(real_fops)) {
-#ifdef MODULE
+#ifdef CONFIG_MODULES
if (real_fops->owner &&
real_fops->owner->state == MODULE_STATE_GOING)
goto out;
--
2.26.2


2020-09-04 11:45:55

by Vladis Dronov

[permalink] [raw]
Subject: Re: [PATCH] debugfs: Fix module state check condition

Hello,

Dear maintainers, could you please look at the above patch, that
previously was sent during a merge window?

A customer which has reported this issue replied with a test result:

> I ran the same test.
> Started ib_write_bw traffic and started watch command to read RoCE
> stats : watch -d -n 1 "cat /sys/kernel/debug/bnxt_re/bnxt_re0/info".
> While the command is running, unloaded roce driver and I did not
> observe the call trace that was seen earlier.

Regards,
Vladis

2020-09-04 11:53:42

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] debugfs: Fix module state check condition

On Fri, Sep 04, 2020 at 01:42:07PM +0200, Vladis Dronov wrote:
> Hello,
>
> Dear maintainers, could you please look at the above patch, that
> previously was sent during a merge window?
>
> A customer which has reported this issue replied with a test result:
>
> > I ran the same test.
> > Started ib_write_bw traffic and started watch command to read RoCE
> > stats : watch -d -n 1 "cat /sys/kernel/debug/bnxt_re/bnxt_re0/info".
> > While the command is running, unloaded roce driver and I did not
> > observe the call trace that was seen earlier.

It's in my queue, but bugs you can only trigger while root are a bit
lower on the priority list :)

thanks,

greg k-h

2020-09-04 12:01:20

by Vladis Dronov

[permalink] [raw]
Subject: Re: [PATCH] debugfs: Fix module state check condition

Hello, Greg, all,

----- Original Message -----
> From: "Greg KH" <[email protected]>
> Subject: Re: [PATCH] debugfs: Fix module state check condition
>
...skip...
>
> It's in my queue, but bugs you can only trigger while root are a bit
> lower on the priority list :)

Oh, apologies. I really thought this has been somehow lost/slipped.
Thank you for the reply and a confirmation.

/me stops bothering people.

> thanks,
>
> greg k-h
>
>

Regards,
Vladis

2020-09-04 16:13:40

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] debugfs: Fix module state check condition

On Fri, Sep 04, 2020 at 01:42:07PM +0200, Vladis Dronov wrote:
> Hello,
>
> Dear maintainers, could you please look at the above patch, that
> previously was sent during a merge window?
>
> A customer which has reported this issue replied with a test result:
>
> > I ran the same test.
> > Started ib_write_bw traffic and started watch command to read RoCE
> > stats : watch -d -n 1 "cat /sys/kernel/debug/bnxt_re/bnxt_re0/info".
> > While the command is running, unloaded roce driver and I did not
> > observe the call trace that was seen earlier.

Having this info, that this was affecting a user, would have been good
in the original changelog info, otherwise this just looked like a code
cleanup patch to me.

I'll go queue this up now, thanks.

greg k-h

2020-09-07 11:52:41

by Vladis Dronov

[permalink] [raw]
Subject: Re: [PATCH] debugfs: Fix module state check condition

Hello, Greg,

----- Original Message -----
> From: "Greg KH" <[email protected]>
> Subject: Re: [PATCH] debugfs: Fix module state check condition
>
...skip...
> > A customer which has reported this issue replied with a test result:
> >
> > > I ran the same test.
> > > Started ib_write_bw traffic and started watch command to read RoCE
> > > stats : watch -d -n 1 "cat /sys/kernel/debug/bnxt_re/bnxt_re0/info".
> > > While the command is running, unloaded roce driver and I did not
> > > observe the call trace that was seen earlier.
>
> Having this info, that this was affecting a user, would have been good
> in the original changelog info, otherwise this just looked like a code
> cleanup patch to me.

Thank you, Greg. Makes sense indeed, I will pay attention to this next time(s).

<rant>oh so many little but important details to know and follow...</rant>

> I'll go queue this up now, thanks.
>
> greg k-h

Best regards,
Vladis Dronov | Red Hat, Inc. | The Core Kernel | Senior Software Engineer