Skip to contentSkip to conversation

debugfs: Fix module state check condition

PATCH In review Vladis Dronov 2 participants 6 messages Aug 11, 2020 – Sep 7, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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()")
---
 fs/debugfs/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/debugfs/file.c +2 -2
index b167d2d02148..a768a09430c3 100644
@@ -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;
Signature · 1 line
2.26.2
#1 lore raw

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:

Quoted 5 lines

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

maintainer
#2 lore raw
Quoted 12 lines · Vladis Dronov

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:

Quoted 5 lines

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

#3 lore raw

Hello, Greg, all,

----- Original Message -----

Quoted 3 lines

From: "Greg KH" <[email protected]>
Subject: Re: [PATCH] debugfs: Fix module state check condition

...skip...

Quoted 3 lines

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.

Quoted 5 lines

thanks,

greg k-h

Regards,
Vladis

maintainer
#4 lore raw
In reply to Vladis Dronov
Quoted 12 lines · Vladis Dronov

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:

Quoted 5 lines

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

#5 lore raw

Hello, Greg,

----- Original Message -----

Quoted 3 lines

From: "Greg KH" <[email protected]>
Subject: Re: [PATCH] debugfs: Fix module state check condition

...skip...

Quoted 11 lines
Quoted 7 lines

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

Quoted 5 lines

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>

Quoted 3 lines

I'll go queue this up now, thanks.

greg k-h

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