diff mbox series

[RESEND] ALSA: info: Fix llseek return value when using callback

Message ID 20220817124924.3974577-1-amadeuszx.slawinski@linux.intel.com (mailing list archive)
State Accepted
Commit 9be080edcca330be4af06b19916c35227891e8bc
Headers show
Series [RESEND] ALSA: info: Fix llseek return value when using callback | expand

Commit Message

Amadeusz Sławiński Aug. 17, 2022, 12:49 p.m. UTC
When using callback there was a flow of

	ret = -EINVAL
	if (callback) {
		offset = callback();
		goto out;
	}
	...
	offset = some other value in case of no callback;
	ret = offset;
out:
	return ret;

which causes the snd_info_entry_llseek() to return -EINVAL when there is
callback handler. Fix this by setting "ret" directly to callback return
value before jumping to "out".

73029e0ff18d ("ALSA: info - Implement common llseek for binary mode")
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
---
 sound/core/info.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Amadeusz Sławiński Aug. 17, 2022, 12:56 p.m. UTC | #1
On 8/17/2022 2:49 PM, Amadeusz Sławiński wrote:
> When using callback there was a flow of
> 
> 	ret = -EINVAL
> 	if (callback) {
> 		offset = callback();
> 		goto out;
> 	}
> 	...
> 	offset = some other value in case of no callback;
> 	ret = offset;
> out:
> 	return ret;
> 
> which causes the snd_info_entry_llseek() to return -EINVAL when there is
> callback handler. Fix this by setting "ret" directly to callback return
> value before jumping to "out".
> 
> 73029e0ff18d ("ALSA: info - Implement common llseek for binary mode")
> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
> ---
>   sound/core/info.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/core/info.c b/sound/core/info.c
> index b8058b341178..0b2f04dcb589 100644
> --- a/sound/core/info.c
> +++ b/sound/core/info.c
> @@ -111,9 +111,9 @@ static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig)
>   	entry = data->entry;
>   	mutex_lock(&entry->access);
>   	if (entry->c.ops->llseek) {
> -		offset = entry->c.ops->llseek(entry,
> -					      data->file_private_data,
> -					      file, offset, orig);
> +		ret = entry->c.ops->llseek(entry,
> +					   data->file_private_data,
> +					   file, offset, orig);
>   		goto out;
>   	}
>   

Doing resend, because I did copy paste mistake when pasting Takashi 
email to git command, additionally alsa-devel blocked my previous mail.
I've seen that Cezary already discussed this issue, and it doesn't seem 
to be fixed, can this be somehow investigated? I guess we can provide 
response we get from server when email fails?

For example lkml accepted both messages just fine...
previous mail:
https://lore.kernel.org/lkml/20220817124642.3974015-1-amadeuszx.slawinski@linux.intel.com/T/#u
and resend:
https://lore.kernel.org/lkml/20220817124924.3974577-1-amadeuszx.slawinski@linux.intel.com/T/#u
Takashi Iwai Aug. 17, 2022, 1:12 p.m. UTC | #2
On Wed, 17 Aug 2022 14:56:05 +0200,
Amadeusz Sławiński wrote:
> 
> On 8/17/2022 2:49 PM, Amadeusz Sławiński wrote:
> > When using callback there was a flow of
> > 
> > 	ret = -EINVAL
> > 	if (callback) {
> > 		offset = callback();
> > 		goto out;
> > 	}
> > 	...
> > 	offset = some other value in case of no callback;
> > 	ret = offset;
> > out:
> > 	return ret;
> > 
> > which causes the snd_info_entry_llseek() to return -EINVAL when there is
> > callback handler. Fix this by setting "ret" directly to callback return
> > value before jumping to "out".
> > 
> > 73029e0ff18d ("ALSA: info - Implement common llseek for binary mode")
> > Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
> > ---
> >   sound/core/info.c | 6 +++---
> >   1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/sound/core/info.c b/sound/core/info.c
> > index b8058b341178..0b2f04dcb589 100644
> > --- a/sound/core/info.c
> > +++ b/sound/core/info.c
> > @@ -111,9 +111,9 @@ static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig)
> >   	entry = data->entry;
> >   	mutex_lock(&entry->access);
> >   	if (entry->c.ops->llseek) {
> > -		offset = entry->c.ops->llseek(entry,
> > -					      data->file_private_data,
> > -					      file, offset, orig);
> > +		ret = entry->c.ops->llseek(entry,
> > +					   data->file_private_data,
> > +					   file, offset, orig);
> >   		goto out;
> >   	}
> >   
> 
> Doing resend, because I did copy paste mistake when pasting Takashi
> email to git command, additionally alsa-devel blocked my previous
> mail.
> I've seen that Cezary already discussed this issue, and it doesn't
> seem to be fixed, can this be somehow investigated? I guess we can
> provide response we get from server when email fails?

It seems working now.  Jaroslav mentioned that it was some DNS
problem.


Takashi
Takashi Iwai Aug. 17, 2022, 1:15 p.m. UTC | #3
On Wed, 17 Aug 2022 14:49:24 +0200,
Amadeusz Sławiński wrote:
> 
> When using callback there was a flow of
> 
> 	ret = -EINVAL
> 	if (callback) {
> 		offset = callback();
> 		goto out;
> 	}
> 	...
> 	offset = some other value in case of no callback;
> 	ret = offset;
> out:
> 	return ret;
> 
> which causes the snd_info_entry_llseek() to return -EINVAL when there is
> callback handler. Fix this by setting "ret" directly to callback return
> value before jumping to "out".
> 
> 73029e0ff18d ("ALSA: info - Implement common llseek for binary mode")

Fixes tag seems missing.  I corrected locally.

> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>

Applied now (with Cc to stable).


thanks,

Takashi
Jaroslav Kysela Aug. 17, 2022, 1:50 p.m. UTC | #4
On 17. 08. 22 15:12, Takashi Iwai wrote:
> On Wed, 17 Aug 2022 14:56:05 +0200,
> Amadeusz Sławiński wrote:
>>
>> On 8/17/2022 2:49 PM, Amadeusz Sławiński wrote:
>>> When using callback there was a flow of
>>>
>>> 	ret = -EINVAL
>>> 	if (callback) {
>>> 		offset = callback();
>>> 		goto out;
>>> 	}
>>> 	...
>>> 	offset = some other value in case of no callback;
>>> 	ret = offset;
>>> out:
>>> 	return ret;
>>>
>>> which causes the snd_info_entry_llseek() to return -EINVAL when there is
>>> callback handler. Fix this by setting "ret" directly to callback return
>>> value before jumping to "out".
>>>
>>> 73029e0ff18d ("ALSA: info - Implement common llseek for binary mode")
>>> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
>>> ---
>>>    sound/core/info.c | 6 +++---
>>>    1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/sound/core/info.c b/sound/core/info.c
>>> index b8058b341178..0b2f04dcb589 100644
>>> --- a/sound/core/info.c
>>> +++ b/sound/core/info.c
>>> @@ -111,9 +111,9 @@ static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig)
>>>    	entry = data->entry;
>>>    	mutex_lock(&entry->access);
>>>    	if (entry->c.ops->llseek) {
>>> -		offset = entry->c.ops->llseek(entry,
>>> -					      data->file_private_data,
>>> -					      file, offset, orig);
>>> +		ret = entry->c.ops->llseek(entry,
>>> +					   data->file_private_data,
>>> +					   file, offset, orig);
>>>    		goto out;
>>>    	}
>>>    
>>
>> Doing resend, because I did copy paste mistake when pasting Takashi
>> email to git command, additionally alsa-devel blocked my previous
>> mail.
>> I've seen that Cezary already discussed this issue, and it doesn't
>> seem to be fixed, can this be somehow investigated? I guess we can
>> provide response we get from server when email fails?
> 
> It seems working now.  Jaroslav mentioned that it was some DNS
> problem.

It seems that my MTA was affected by this problem:

https://www.claudiokuenzler.com/blog/1231/postfix-reject-mails-blocked-using-zen-spamhaus-dnsbl-open-resolver

I changed DNS servers, so the problem should be fixed. I will monitor the 
situation next days.

Thank you all for the feedback.

						Jaroslav
diff mbox series

Patch

diff --git a/sound/core/info.c b/sound/core/info.c
index b8058b341178..0b2f04dcb589 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -111,9 +111,9 @@  static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig)
 	entry = data->entry;
 	mutex_lock(&entry->access);
 	if (entry->c.ops->llseek) {
-		offset = entry->c.ops->llseek(entry,
-					      data->file_private_data,
-					      file, offset, orig);
+		ret = entry->c.ops->llseek(entry,
+					   data->file_private_data,
+					   file, offset, orig);
 		goto out;
 	}