linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Locking problem in autofs4_expire(), 2.4.0-test10
@ 2000-11-04  1:57 Nigel Gamble
  2000-11-06  0:34 ` Nigel Gamble
  0 siblings, 1 reply; 2+ messages in thread
From: Nigel Gamble @ 2000-11-04  1:57 UTC (permalink / raw)
  To: jeremy; +Cc: linux-kernel

dput() is called with dcache_lock already held, resulting in deadlock.

Here is a suggested fix:

===== expire.c 1.3 vs edited =====
--- 1.3/linux/fs/autofs4/expire.c       Tue Oct 31 15:14:06 2000
+++ edited/expire.c     Fri Nov  3 17:47:47 2000
@@ -223,8 +223,10 @@
                        mntput(p);
                        return dentry;
                }
+               spin_unlock(&dcache_lock);
                dput(d);
                mntput(p);
+               spin_lock(&dcache_lock);
        }
        spin_unlock(&dcache_lock);

Nigel Gamble
MontaVista Software

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

* Re: Locking problem in autofs4_expire(), 2.4.0-test10
  2000-11-04  1:57 Locking problem in autofs4_expire(), 2.4.0-test10 Nigel Gamble
@ 2000-11-06  0:34 ` Nigel Gamble
  0 siblings, 0 replies; 2+ messages in thread
From: Nigel Gamble @ 2000-11-06  0:34 UTC (permalink / raw)
  To: jeremy; +Cc: linux-kernel, autofs

On Fri, 3 Nov 2000, Nigel Gamble wrote:
>
> dput() is called with dcache_lock already held, resulting in deadlock.
> 
> Here is a suggested fix:
> 
> ===== expire.c 1.3 vs edited =====
> --- 1.3/linux/fs/autofs4/expire.c       Tue Oct 31 15:14:06 2000
> +++ edited/expire.c     Fri Nov  3 17:47:47 2000
> @@ -223,8 +223,10 @@
>                         mntput(p);
>                         return dentry;
>                 }
> +               spin_unlock(&dcache_lock);
>                 dput(d);
>                 mntput(p);
> +               spin_lock(&dcache_lock);
>         }
>         spin_unlock(&dcache_lock);

On looking at this code more closely, I don't think it's safe just
to drop the lock, because it looks like the lock is supposed to
protect the loop variable, tmp, and the data structure which
is being traversed.  However, I'm not familiar with this code,
so I'm hoping someone who is can come up with a correct solution
to this deadlock problem.

Nigel

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

end of thread, other threads:[~2000-11-06  0:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-04  1:57 Locking problem in autofs4_expire(), 2.4.0-test10 Nigel Gamble
2000-11-06  0:34 ` Nigel Gamble

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).