All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Reset file->f_op in snd_card_file_remove()
@ 2006-09-27 19:27 Karsten Wiese
  2006-09-28 10:08   ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: Karsten Wiese @ 2006-09-27 19:27 UTC (permalink / raw)
  To: Takashi Iwai, mingo; +Cc: alsa-devel, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 1203 bytes --]

Hi

This patch helps prevent an oops on 2.6.18-rt3,
when my usb usx2y soundcard disconnects.
Physically disconnects or "rmmod uhci_hc" both oops 1in7.

With this patch still no oops after > 1000 disconnects.

Please apply/comment.

      thanks,
      Karsten

===

Reset file->f_op in snd_card_file_remove()

When passing here in response to an usb disconnect,
file->f_op has been replaced with a kmalloc()ed version,
that would only allow releases.

It will be free()ed later on in snd_card_free().
Here it happened sometimes, that the free()ed, not NULLed file->f_op
caused an oops in module_put() called by fops_put() still later on.

Signed-off-by: Karsten Wiese <annabellesgarden@yahoo.de>



--- rt3/sound/core/init.c	2006-09-23 20:03:18.000000000 +0200
+++ rt3-kw/sound/core/init.c	2006-09-27 20:44:54.000000000 +0200
@@ -722,6 +722,7 @@ int snd_card_file_remove(struct snd_card
 	mfile = card->files;
 	while (mfile) {
 		if (mfile->file == file) {
+			file->f_op = NULL;
 			if (pfile)
 				pfile->next = mfile->next;
 			else

	

	
		
___________________________________________________________ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de



[-- Attachment #2: Type: text/plain, Size: 348 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #3: Type: text/plain, Size: 161 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

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

* Re: [PATCH] Reset file->f_op in snd_card_file_remove()
  2006-09-27 19:27 [PATCH] Reset file->f_op in snd_card_file_remove() Karsten Wiese
@ 2006-09-28 10:08   ` Takashi Iwai
  0 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2006-09-28 10:08 UTC (permalink / raw)
  To: Karsten Wiese; +Cc: mingo, alsa-devel, linux-kernel

At Wed, 27 Sep 2006 21:27:51 +0200,
Karsten Wiese wrote:
> 
> Hi
> 
> This patch helps prevent an oops on 2.6.18-rt3,
> when my usb usx2y soundcard disconnects.
> Physically disconnects or "rmmod uhci_hc" both oops 1in7.
> 
> With this patch still no oops after > 1000 disconnects.
> 
> Please apply/comment.
> 
>       thanks,
>       Karsten
> 
> ===
> 
> Reset file->f_op in snd_card_file_remove()
> 
> When passing here in response to an usb disconnect,
> file->f_op has been replaced with a kmalloc()ed version,
> that would only allow releases.
> 
> It will be free()ed later on in snd_card_free().
> Here it happened sometimes, that the free()ed, not NULLed file->f_op
> caused an oops in module_put() called by fops_put() still later on.
> 
> Signed-off-by: Karsten Wiese <annabellesgarden@yahoo.de>

snd_card_file_remove() is not a right place to do that, IMO.

Could you check whether this problem still happens on post-2.6.18?
There are a lot of fixes in this area after 2.6.18.


Takashi
> 
> 
> 
> --- rt3/sound/core/init.c	2006-09-23 20:03:18.000000000 +0200
> +++ rt3-kw/sound/core/init.c	2006-09-27 20:44:54.000000000 +0200
> @@ -722,6 +722,7 @@ int snd_card_file_remove(struct snd_card
>  	mfile = card->files;
>  	while (mfile) {
>  		if (mfile->file == file) {
> +			file->f_op = NULL;
>  			if (pfile)
>  				pfile->next = mfile->next;
>  			else
> 
> 	
> 
> 	
> 		
> ___________________________________________________________ 
> Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
> 

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

* Re: [PATCH] Reset file->f_op in snd_card_file_remove()
@ 2006-09-28 10:08   ` Takashi Iwai
  0 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2006-09-28 10:08 UTC (permalink / raw)
  To: Karsten Wiese; +Cc: mingo, alsa-devel, linux-kernel

At Wed, 27 Sep 2006 21:27:51 +0200,
Karsten Wiese wrote:
> 
> Hi
> 
> This patch helps prevent an oops on 2.6.18-rt3,
> when my usb usx2y soundcard disconnects.
> Physically disconnects or "rmmod uhci_hc" both oops 1in7.
> 
> With this patch still no oops after > 1000 disconnects.
> 
> Please apply/comment.
> 
>       thanks,
>       Karsten
> 
> ===
> 
> Reset file->f_op in snd_card_file_remove()
> 
> When passing here in response to an usb disconnect,
> file->f_op has been replaced with a kmalloc()ed version,
> that would only allow releases.
> 
> It will be free()ed later on in snd_card_free().
> Here it happened sometimes, that the free()ed, not NULLed file->f_op
> caused an oops in module_put() called by fops_put() still later on.
> 
> Signed-off-by: Karsten Wiese <annabellesgarden@yahoo.de>

snd_card_file_remove() is not a right place to do that, IMO.

Could you check whether this problem still happens on post-2.6.18?
There are a lot of fixes in this area after 2.6.18.


Takashi
> 
> 
> 
> --- rt3/sound/core/init.c	2006-09-23 20:03:18.000000000 +0200
> +++ rt3-kw/sound/core/init.c	2006-09-27 20:44:54.000000000 +0200
> @@ -722,6 +722,7 @@ int snd_card_file_remove(struct snd_card
>  	mfile = card->files;
>  	while (mfile) {
>  		if (mfile->file == file) {
> +			file->f_op = NULL;
>  			if (pfile)
>  				pfile->next = mfile->next;
>  			else
> 
> 	
> 
> 	
> 		
> ___________________________________________________________ 
> Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
> 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

* Re: [PATCH] Reset file->f_op in snd_card_file_remove()
  2006-09-28 10:08   ` Takashi Iwai
@ 2006-09-28 11:39     ` karsten wiese
  -1 siblings, 0 replies; 8+ messages in thread
From: karsten wiese @ 2006-09-28 11:39 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: mingo, alsa-devel, linux-kernel

--- Takashi Iwai <tiwai@suse.de> schrieb:

> At Wed, 27 Sep 2006 21:27:51 +0200,
> Karsten Wiese wrote:
> > 
> > Hi
> > 
> > This patch helps prevent an oops on 2.6.18-rt3,
> > when my usb usx2y soundcard disconnects.
> > Physically disconnects or "rmmod uhci_hc" both oops 1in7.
> > 
> > With this patch still no oops after > 1000 disconnects.
> > 
> > Please apply/comment.
> > 
> >       thanks,
> >       Karsten
> > 
> > ===
> > 
> > Reset file->f_op in snd_card_file_remove()
> > 
> > When passing here in response to an usb disconnect,
> > file->f_op has been replaced with a kmalloc()ed version,
> > that would only allow releases.
> > 
> > It will be free()ed later on in snd_card_free().
> > Here it happened sometimes, that the free()ed, not NULLed file->f_op
> > caused an oops in module_put() called by fops_put() still later on.
> > 
> > Signed-off-by: Karsten Wiese <annabellesgarden@yahoo.de>
> 
> snd_card_file_remove() is not a right place to do that, IMO.
> 
you are right, patch is wrong: it causes snd_hwdep's use count corruption.

> Could you check whether this problem still happens on post-2.6.18?
> There are a lot of fixes in this area after 2.6.18.
> 
i'm now running 2.6.18-rt3 + alsa-driver-1.0.13rc1 and problem seams to be gone.

      Karsten


	

	
		
___________________________________________________________ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de

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

* Re: [PATCH] Reset file->f_op in snd_card_file_remove()
@ 2006-09-28 11:39     ` karsten wiese
  0 siblings, 0 replies; 8+ messages in thread
From: karsten wiese @ 2006-09-28 11:39 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: mingo, alsa-devel, linux-kernel

--- Takashi Iwai <tiwai@suse.de> schrieb:

> At Wed, 27 Sep 2006 21:27:51 +0200,
> Karsten Wiese wrote:
> > 
> > Hi
> > 
> > This patch helps prevent an oops on 2.6.18-rt3,
> > when my usb usx2y soundcard disconnects.
> > Physically disconnects or "rmmod uhci_hc" both oops 1in7.
> > 
> > With this patch still no oops after > 1000 disconnects.
> > 
> > Please apply/comment.
> > 
> >       thanks,
> >       Karsten
> > 
> > ===
> > 
> > Reset file->f_op in snd_card_file_remove()
> > 
> > When passing here in response to an usb disconnect,
> > file->f_op has been replaced with a kmalloc()ed version,
> > that would only allow releases.
> > 
> > It will be free()ed later on in snd_card_free().
> > Here it happened sometimes, that the free()ed, not NULLed file->f_op
> > caused an oops in module_put() called by fops_put() still later on.
> > 
> > Signed-off-by: Karsten Wiese <annabellesgarden@yahoo.de>
> 
> snd_card_file_remove() is not a right place to do that, IMO.
> 
you are right, patch is wrong: it causes snd_hwdep's use count corruption.

> Could you check whether this problem still happens on post-2.6.18?
> There are a lot of fixes in this area after 2.6.18.
> 
i'm now running 2.6.18-rt3 + alsa-driver-1.0.13rc1 and problem seams to be gone.

      Karsten


	

	
		
___________________________________________________________ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

* Re: [Alsa-devel] [PATCH] Reset file->f_op in snd_card_file_remove()
  2006-09-28 11:39     ` karsten wiese
  (?)
@ 2006-09-28 11:46     ` karsten wiese
  -1 siblings, 0 replies; 8+ messages in thread
From: karsten wiese @ 2006-09-28 11:46 UTC (permalink / raw)
  To: karsten wiese, Takashi Iwai; +Cc: mingo, alsa-devel, linux-kernel


--- karsten wiese <annabellesgarden@yahoo.de> schrieb:
> i'm now running 2.6.18-rt3 + alsa-driver-1.0.13rc1 and problem seams to be gone.
> 
its alsa-driver-1.0.13rc3.

      Karsten


	

	
		
___________________________________________________________ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de

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

* Re: [Alsa-devel] [PATCH] Reset file->f_op in snd_card_file_remove()
  2006-09-28 11:39     ` karsten wiese
@ 2006-09-28 12:51       ` Takashi Iwai
  -1 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2006-09-28 12:51 UTC (permalink / raw)
  To: karsten wiese; +Cc: mingo, alsa-devel, linux-kernel

At Thu, 28 Sep 2006 13:39:06 +0200 (CEST),
karsten wiese wrote:
> 
> --- Takashi Iwai <tiwai@suse.de> schrieb:
> 
> > At Wed, 27 Sep 2006 21:27:51 +0200,
> > Karsten Wiese wrote:
> > > 
> > > Hi
> > > 
> > > This patch helps prevent an oops on 2.6.18-rt3,
> > > when my usb usx2y soundcard disconnects.
> > > Physically disconnects or "rmmod uhci_hc" both oops 1in7.
> > > 
> > > With this patch still no oops after > 1000 disconnects.
> > > 
> > > Please apply/comment.
> > > 
> > >       thanks,
> > >       Karsten
> > > 
> > > ===
> > > 
> > > Reset file->f_op in snd_card_file_remove()
> > > 
> > > When passing here in response to an usb disconnect,
> > > file->f_op has been replaced with a kmalloc()ed version,
> > > that would only allow releases.
> > > 
> > > It will be free()ed later on in snd_card_free().
> > > Here it happened sometimes, that the free()ed, not NULLed file->f_op
> > > caused an oops in module_put() called by fops_put() still later on.
> > > 
> > > Signed-off-by: Karsten Wiese <annabellesgarden@yahoo.de>
> > 
> > snd_card_file_remove() is not a right place to do that, IMO.
> > 
> you are right, patch is wrong: it causes snd_hwdep's use count corruption.
> 
> > Could you check whether this problem still happens on post-2.6.18?
> > There are a lot of fixes in this area after 2.6.18.
> > 
> i'm now running 2.6.18-rt3 + alsa-driver-1.0.13rc1 and problem seams to be gone.

Good to hear.  Thanks for confirmation!


Takashi

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

* Re: [PATCH] Reset file->f_op in snd_card_file_remove()
@ 2006-09-28 12:51       ` Takashi Iwai
  0 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2006-09-28 12:51 UTC (permalink / raw)
  To: karsten wiese; +Cc: mingo, alsa-devel, linux-kernel

At Thu, 28 Sep 2006 13:39:06 +0200 (CEST),
karsten wiese wrote:
> 
> --- Takashi Iwai <tiwai@suse.de> schrieb:
> 
> > At Wed, 27 Sep 2006 21:27:51 +0200,
> > Karsten Wiese wrote:
> > > 
> > > Hi
> > > 
> > > This patch helps prevent an oops on 2.6.18-rt3,
> > > when my usb usx2y soundcard disconnects.
> > > Physically disconnects or "rmmod uhci_hc" both oops 1in7.
> > > 
> > > With this patch still no oops after > 1000 disconnects.
> > > 
> > > Please apply/comment.
> > > 
> > >       thanks,
> > >       Karsten
> > > 
> > > ===
> > > 
> > > Reset file->f_op in snd_card_file_remove()
> > > 
> > > When passing here in response to an usb disconnect,
> > > file->f_op has been replaced with a kmalloc()ed version,
> > > that would only allow releases.
> > > 
> > > It will be free()ed later on in snd_card_free().
> > > Here it happened sometimes, that the free()ed, not NULLed file->f_op
> > > caused an oops in module_put() called by fops_put() still later on.
> > > 
> > > Signed-off-by: Karsten Wiese <annabellesgarden@yahoo.de>
> > 
> > snd_card_file_remove() is not a right place to do that, IMO.
> > 
> you are right, patch is wrong: it causes snd_hwdep's use count corruption.
> 
> > Could you check whether this problem still happens on post-2.6.18?
> > There are a lot of fixes in this area after 2.6.18.
> > 
> i'm now running 2.6.18-rt3 + alsa-driver-1.0.13rc1 and problem seams to be gone.

Good to hear.  Thanks for confirmation!


Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

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

end of thread, other threads:[~2006-09-28 12:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-27 19:27 [PATCH] Reset file->f_op in snd_card_file_remove() Karsten Wiese
2006-09-28 10:08 ` Takashi Iwai
2006-09-28 10:08   ` Takashi Iwai
2006-09-28 11:39   ` karsten wiese
2006-09-28 11:39     ` karsten wiese
2006-09-28 11:46     ` [Alsa-devel] " karsten wiese
2006-09-28 12:51     ` Takashi Iwai
2006-09-28 12:51       ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.