linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / autofs / root.c
index 5637061..870e2cf 100644 (file)
@@ -10,6 +10,7 @@
  *
  * ------------------------------------------------------------------------- */
 
+#include <linux/capability.h>
 #include <linux/errno.h>
 #include <linux/stat.h>
 #include <linux/param.h>
@@ -229,18 +230,24 @@ static struct dentry *autofs_root_lookup(struct inode *dir, struct dentry *dentr
        dentry->d_flags |= DCACHE_AUTOFS_PENDING;
        d_add(dentry, NULL);
 
-       up(&dir->i_sem);
+       mutex_unlock(&dir->i_mutex);
        autofs_revalidate(dentry, nd);
-       down(&dir->i_sem);
+       mutex_lock(&dir->i_mutex);
 
        /*
         * If we are still pending, check if we had to handle
         * a signal. If so we can force a restart..
         */
        if (dentry->d_flags & DCACHE_AUTOFS_PENDING) {
+               /* See if we were interrupted */
                if (signal_pending(current)) {
-                       unlock_kernel();
-                       return ERR_PTR(-ERESTARTNOINTR);
+                       sigset_t *sigset = &current->pending.signal;
+                       if (sigismember (sigset, SIGKILL) ||
+                           sigismember (sigset, SIGQUIT) ||
+                           sigismember (sigset, SIGINT)) {
+                               unlock_kernel();
+                               return ERR_PTR(-ERESTARTNOINTR);
+                       }
                }
        }
        unlock_kernel();