Browse Source

Plan 9 from Bell Labs 2003-02-04

David du Colombier 21 years ago
parent
commit
0e3256d405
4 changed files with 17 additions and 13 deletions
  1. 2 2
      dist/replica/plan9.db
  2. 2 0
      dist/replica/plan9.log
  3. 5 7
      sys/src/fs/emelie/mkfile
  4. 8 4
      sys/src/fs/port/9p2.c

+ 2 - 2
dist/replica/plan9.db

@@ -10569,7 +10569,7 @@ sys/src/fs/emelie/dat.h - 664 sys sys 1037805101 502
 sys/src/fs/emelie/fns.h - 664 sys sys 1037805101 1968
 sys/src/fs/emelie/io.h - 664 sys sys 1037805101 6576
 sys/src/fs/emelie/mem.h - 664 sys sys 1015110098 2865
-sys/src/fs/emelie/mkfile - 664 sys sys 1037805101 1666
+sys/src/fs/emelie/mkfile - 664 sys sys 1044290928 1691
 sys/src/fs/ip - 20000000775 sys sys 1015109990 0
 sys/src/fs/ip/arp.c - 664 sys sys 1015109981 8696
 sys/src/fs/ip/icmp.c - 664 sys sys 1015109981 991
@@ -10623,7 +10623,7 @@ sys/src/fs/port - 20000000775 sys sys 1015110029 0
 sys/src/fs/port/9p1.c - 664 sys sys 1015109993 30114
 sys/src/fs/port/9p1.h - 664 sys sys 1015109994 2122
 sys/src/fs/port/9p1lib.c - 664 sys sys 1015109996 7629
-sys/src/fs/port/9p2.c - 664 sys sys 1041361346 36053
+sys/src/fs/port/9p2.c - 664 sys sys 1044290935 36142
 sys/src/fs/port/all.h - 664 sys sys 1015110002 1883
 sys/src/fs/port/auth.c - 664 sys sys 1041361345 7608
 sys/src/fs/port/chk.c - 664 sys sys 1037805158 13882

+ 2 - 0
dist/replica/plan9.log

@@ -17140,3 +17140,5 @@
 1044034220 1 m sys/src/9/bitsy/sd.h - 664 sys sys 1037029038 0
 1044034220 2 m sys/src/9/bitsy/sdata.c - 664 sys sys 1037029041 44666
 1044052234 0 c sys/man/2/9p - 664 sys sys 1044050898 14553
+1044291726 0 c sys/src/fs/emelie/mkfile - 664 sys sys 1044290928 1691
+1044291726 1 c sys/src/fs/port/9p2.c - 664 sys sys 1044290935 36142

+ 5 - 7
sys/src/fs/emelie/mkfile

@@ -101,9 +101,9 @@ HFILES=\
 	/$objtype/include/ureg.h\
 
 LIB=\
-	-lauthsrv\
+	/$objtype/lib/libauthsrv.a\
 	/$objtype/lib/libc.a\
-	-lsec\
+	/$objtype/lib/libsec.a\
 
 # -I../pc & -DFS are for compat.h
 CFLAGS=-FVw -I. -I../port -I../pc -DFS
@@ -115,12 +115,10 @@ all:V:	$TARG
 <../dev/mkfile
 <../ip/mkfile
 
-$TARG:	$OBJ $TARG.$O
-	$LD -o $target -l -T0x80100020 $prereq $LIB
-	size $target
-
-$TARG.$O:	$TARG.c
+$TARG:	$TARG.c $OBJ $LIB
 	$CC $CFLAGS -DDATE'='`{date -n} $TARG.c
+	$LD -o $target -l -T0x80100020 $OBJ $TARG.$O $LIB
+	size $target
 
 install:V: $TARG
 	cp $TARG /$objtype/

+ 8 - 4
sys/src/fs/port/9p2.c

@@ -1645,8 +1645,14 @@ wstat(Chan* chan, Fcall* f, Fcall*, char* strs)
 	 */
 	if(dir.name != d->name){
 		/*
-		 * Get parent.
+		 * First get parent.
+		 * Must drop current entry to prevent
+		 * deadlock when searching that new name
+		 * already exists below.
 		 */
+		putbuf(p);
+		p = nil;
+
 		if(file->wpath == nil){
 			error = Ephase;
 			goto out;
@@ -1663,10 +1669,8 @@ wstat(Chan* chan, Fcall* f, Fcall*, char* strs)
 		}
 
 		/*
-		 * Drop entry to prevent lock, then
-		 * check that destination name is unique.
+		 * Check entries in parent for new name.
 		 */
-		putbuf(p);
 		for(addr = 0; ; addr++){
 			if((p = dnodebuf(p1, d1, addr, 0, file->uid)) == nil)
 				break;