summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/lib9p/file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/src/lib9p/file.c b/sys/src/lib9p/file.c
index 54e09d278..476a8e052 100644
--- a/sys/src/lib9p/file.c
+++ b/sys/src/lib9p/file.c
@@ -191,6 +191,12 @@ createfile(File *fp, char *name, char *uid, ulong perm, void *aux)
}
wlock(fp);
+ if(fp->parent == nil){
+ wunlock(fp);
+ werrstr("create in deleted directory");
+ return nil;
+ }
+
/*
* We might encounter blank spots along the
* way due to deleted files that have not yet