public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add process name to locks warning
@ 2022-11-18 23:43 Andi Kleen
  2022-11-19  2:06 ` Jeff Layton
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2022-11-18 23:43 UTC (permalink / raw)
  To: jlayton; +Cc: chuck.lever, linux-fsdevel, linux-kernel, Andi Kleen

It's fairly useless to complain about using an obsolete feature without
telling the user which process used it. My Fedora desktop randomly drops
this message, but I would really need this patch to figure out what
triggers is.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 fs/locks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/locks.c b/fs/locks.c
index 607f94a0e789..2e45232dbeb1 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -2096,7 +2096,7 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
 	 * throw a warning to let people know that they don't actually work.
 	 */
 	if (cmd & LOCK_MAND) {
-		pr_warn_once("Attempt to set a LOCK_MAND lock via flock(2). This support has been removed and the request ignored.\n");
+		pr_warn_once("%s: Attempt to set a LOCK_MAND lock via flock(2). This support has been removed and the request ignored.\n", current->comm);
 		return 0;
 	}
 
-- 
2.37.3


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

* Re: [PATCH] Add process name to locks warning
  2022-11-18 23:43 [PATCH] Add process name to locks warning Andi Kleen
@ 2022-11-19  2:06 ` Jeff Layton
  2022-11-19 11:55   ` Jeff Layton
  2022-11-19 14:23   ` Andi Kleen
  0 siblings, 2 replies; 4+ messages in thread
From: Jeff Layton @ 2022-11-19  2:06 UTC (permalink / raw)
  To: Andi Kleen; +Cc: chuck.lever, linux-fsdevel, linux-kernel

On Fri, 2022-11-18 at 15:43 -0800, Andi Kleen wrote:
> It's fairly useless to complain about using an obsolete feature without
> telling the user which process used it. My Fedora desktop randomly drops
> this message, but I would really need this patch to figure out what
> triggers is.
> 

Interesting. The only program I know of that tried to use these was
samba, but we patched that out a few years ago (about the time this
patch went in). Are you running an older version of samba?

> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
>  fs/locks.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/locks.c b/fs/locks.c
> index 607f94a0e789..2e45232dbeb1 100644
> --- a/fs/locks.c
> +++ b/fs/locks.c
> @@ -2096,7 +2096,7 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
>  	 * throw a warning to let people know that they don't actually work.
>  	 */
>  	if (cmd & LOCK_MAND) {
> -		pr_warn_once("Attempt to set a LOCK_MAND lock via flock(2). This support has been removed and the request ignored.\n");
> +		pr_warn_once("%s: Attempt to set a LOCK_MAND lock via flock(2). This support has been removed and the request ignored.\n", current->comm);
>  		return 0;
>  	}
>  

Looks reasonable. Would it help to print the pid or tgid as well? 
-- 
Jeff Layton <jlayton@kernel.org>

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

* Re: [PATCH] Add process name to locks warning
  2022-11-19  2:06 ` Jeff Layton
@ 2022-11-19 11:55   ` Jeff Layton
  2022-11-19 14:23   ` Andi Kleen
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Layton @ 2022-11-19 11:55 UTC (permalink / raw)
  To: Andi Kleen; +Cc: chuck.lever, linux-fsdevel, linux-kernel

On Fri, 2022-11-18 at 21:06 -0500, Jeff Layton wrote:
> On Fri, 2022-11-18 at 15:43 -0800, Andi Kleen wrote:
> > It's fairly useless to complain about using an obsolete feature without
> > telling the user which process used it. My Fedora desktop randomly drops
> > this message, but I would really need this patch to figure out what
> > triggers is.
> > 
> 
> Interesting. The only program I know of that tried to use these was
> samba, but we patched that out a few years ago (about the time this
> patch went in). Are you running an older version of samba?
> 
> > Signed-off-by: Andi Kleen <ak@linux.intel.com>
> > ---
> >  fs/locks.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fs/locks.c b/fs/locks.c
> > index 607f94a0e789..2e45232dbeb1 100644
> > --- a/fs/locks.c
> > +++ b/fs/locks.c
> > @@ -2096,7 +2096,7 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
> >  	 * throw a warning to let people know that they don't actually work.
> >  	 */
> >  	if (cmd & LOCK_MAND) {
> > -		pr_warn_once("Attempt to set a LOCK_MAND lock via flock(2). This support has been removed and the request ignored.\n");
> > +		pr_warn_once("%s: Attempt to set a LOCK_MAND lock via flock(2). This support has been removed and the request ignored.\n", current->comm);
> >  		return 0;
> >  	}
> >  
> 
> Looks reasonable. Would it help to print the pid or tgid as well? 

Merged into my locks-next branch, along with a small change to print
current->pid in addition to current->comm. This should make v6.2.

Thanks!
-- 
Jeff Layton <jlayton@kernel.org>

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

* Re: [PATCH] Add process name to locks warning
  2022-11-19  2:06 ` Jeff Layton
  2022-11-19 11:55   ` Jeff Layton
@ 2022-11-19 14:23   ` Andi Kleen
  1 sibling, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2022-11-19 14:23 UTC (permalink / raw)
  To: Jeff Layton; +Cc: chuck.lever, linux-fsdevel, linux-kernel


On 11/18/2022 6:06 PM, Jeff Layton wrote:
> On Fri, 2022-11-18 at 15:43 -0800, Andi Kleen wrote:
>> It's fairly useless to complain about using an obsolete feature without
>> telling the user which process used it. My Fedora desktop randomly drops
>> this message, but I would really need this patch to figure out what
>> triggers is.
>>
> Interesting. The only program I know of that tried to use these was
> samba, but we patched that out a few years ago (about the time this
> patch went in). Are you running an older version of samba?


Yes it's running samba, whatever is in Fedora 35. Don't know if that 
counts as an

older version.


>
>> Signed-off-by: Andi Kleen <ak@linux.intel.com>
>> ---
>>   fs/locks.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/locks.c b/fs/locks.c
>> index 607f94a0e789..2e45232dbeb1 100644
>> --- a/fs/locks.c
>> +++ b/fs/locks.c
>> @@ -2096,7 +2096,7 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
>>   	 * throw a warning to let people know that they don't actually work.
>>   	 */
>>   	if (cmd & LOCK_MAND) {
>> -		pr_warn_once("Attempt to set a LOCK_MAND lock via flock(2). This support has been removed and the request ignored.\n");
>> +		pr_warn_once("%s: Attempt to set a LOCK_MAND lock via flock(2). This support has been removed and the request ignored.\n", current->comm);
>>   		return 0;
>>   	}
>>   
> Looks reasonable. Would it help to print the pid or tgid as well?

It wouldn't help me because at that time I see it it's likely long gone. 
Just need the name.


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

end of thread, other threads:[~2022-11-19 14:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-18 23:43 [PATCH] Add process name to locks warning Andi Kleen
2022-11-19  2:06 ` Jeff Layton
2022-11-19 11:55   ` Jeff Layton
2022-11-19 14:23   ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox