mkdir: Fix error recover path
authorAlan Cox <alan@linux.intel.com>
Wed, 21 Feb 2018 20:32:26 +0000 (20:32 +0000)
committerAlan Cox <alan@linux.intel.com>
Wed, 21 Feb 2018 20:32:26 +0000 (20:32 +0000)
This tried to unlink random crap not the correct path. Broken when I tidied
up the path walking logic

Kernel/syscall_other.c

index a52ee9a..fc5597d 100644 (file)
@@ -144,7 +144,6 @@ arg_t _mkdir(void)
 {
        inoptr ino;
        inoptr parent;
-       char fname[FILENAME_LEN + 1];
 
        if ((ino = n_open(name, &parent)) != NULL) {
                udata.u_error = EEXIST;
@@ -193,7 +192,7 @@ cleanup:
        i_unlock_deref(ino);
        /* In the error case it may be observed but it's consistently empty */
        i_lock(parent);
-       if (!ch_link(parent, fname, "", NULLINODE))
+       if (!ch_link(parent, lastname, "", NULLINODE))
                kprintf("_mkdir: bad rec\n");
        i_unlock_deref(parent);
        return -1;