]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/mips/kernel/kspd.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[linux-2.6-omap-h63xx.git] / arch / mips / kernel / kspd.c
index d2c2e00e5864ff67802e811acc74fd74a889da08..b0591ae0ce566456ed7c88eaa955d191a17bcaaa 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/sched.h>
 #include <linux/unistd.h>
 #include <linux/file.h>
+#include <linux/fdtable.h>
 #include <linux/fs.h>
 #include <linux/syscalls.h>
 #include <linux/workqueue.h>
@@ -161,8 +162,7 @@ static unsigned int translate_open_flags(int flags)
        int i;
        unsigned int ret = 0;
 
-       for (i = 0; i < (sizeof(open_flags_table) / sizeof(struct apsp_table));
-            i++) {
+       for (i = 0; i < ARRAY_SIZE(open_flags_table); i++) {
                if( (flags & open_flags_table[i].sp) ) {
                        ret |= open_flags_table[i].ap;
                }
@@ -222,7 +222,7 @@ void sp_work_handle_request(void)
                }
        }
 
-       /* Run the syscall at the priviledge of the user who loaded the
+       /* Run the syscall at the privilege of the user who loaded the
           SP program */
 
        if (vpe_getuid(tclimit))
@@ -257,7 +257,7 @@ void sp_work_handle_request(void)
 
                vcwd = vpe_getcwd(tclimit);
 
-               /* change to the cwd of the process that loaded the SP program */
+               /* change to cwd of the process that loaded the SP program */
                old_fs = get_fs();
                set_fs(KERNEL_DS);
                sys_chdir(vcwd);
@@ -323,6 +323,9 @@ static void sp_cleanup(void)
                        set >>= 1;
                }
        }
+
+       /* Put daemon cwd back to root to avoid umount problems */
+       sys_chdir("/");
 }
 
 static int channel_open = 0;