Re: 2.6.17-rc5-mm2

From: Andrew Morton
Date: Thu Jun 01 2006 - 13:30:50 EST


On Thu, 01 Jun 2006 19:20:08 +0200
Arjan van de Ven <arjan@xxxxxxxxxxxxxxx> wrote:

> On Thu, 2006-06-01 at 17:51 +0200, Michal Piotrowski wrote:
> > Hi,
> >
> > On 01/06/06, Andrew Morton <akpm@xxxxxxxx> wrote:
> > >
> > > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.17-rc5/2.6.17-rc5-mm2/
> > >
> >
> > I don't know why, but first bug appears only when avahi-daemon is
> > started. Second look like a problem with my camera.
> > http://www.stardust.webpages.pl/files/mm/2.6.17-rc5-mm2/bug_1.jpg
> > http://www.stardust.webpages.pl/files/mm/2.6.17-rc5-mm2/bug_2.jpg
> >
> > Here is config http://www.stardust.webpages.pl/files/mm/2.6.17-rc5-mm2/mm-config
>
>
> can you confirm this fixes it ?
>

s/fixes it/makes it go away/

Please describe these patches better.

Where was the outermost lock taken? How do we know that an attempt cannot
be made to take them in the opposite order?


> ---
> drivers/usb/core/inode.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> Index: linux-2.6.17-rc5-mm1.5/drivers/usb/core/inode.c
> ===================================================================
> --- linux-2.6.17-rc5-mm1.5.orig/drivers/usb/core/inode.c
> +++ linux-2.6.17-rc5-mm1.5/drivers/usb/core/inode.c
> @@ -333,7 +333,7 @@ static int usbfs_empty (struct dentry *d
> static int usbfs_unlink (struct inode *dir, struct dentry *dentry)
> {
> struct inode *inode = dentry->d_inode;
> - mutex_lock(&inode->i_mutex);
> + mutex_lock_nested(&inode->i_mutex, I_MUTEX_CHILD);
> dentry->d_inode->i_nlink--;
> dput(dentry);
> mutex_unlock(&inode->i_mutex);
> @@ -346,7 +346,7 @@ static int usbfs_rmdir(struct inode *dir
> int error = -ENOTEMPTY;
> struct inode * inode = dentry->d_inode;
>
> - mutex_lock(&inode->i_mutex);
> + mutex_lock_nested(&inode->i_mutex, I_MUTEX_CHILD);
> dentry_unhash(dentry);
> if (usbfs_empty(dentry)) {
> dentry->d_inode->i_nlink -= 2;
> @@ -528,7 +528,7 @@ static void fs_remove_file (struct dentr
> if (!parent || !parent->d_inode)
> return;
>
> - mutex_lock(&parent->d_inode->i_mutex);
> + mutex_lock_nested(&parent->d_inode->i_mutex, I_MUTEX_PARENT);
> if (usbfs_positive(dentry)) {
> if (dentry->d_inode) {
> if (S_ISDIR(dentry->d_inode->i_mode))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/