Replica/applylog creates new dirs with only DMDIR set, then sets mode with a separate wstat. 9vx/devfs-posix.c adds implicit 0400 to mkdir call to sustain till the wstat. This patch makes u9fs to do the same. A fix for replica/applylog to work over unmodified u9fs would be trivial, too. Reference: /n/sources/patch/applied/u9fs-replica-mkdir Date: Thu Mar 24 16:54:31 CET 2011 Signed-off-by: yarikos@gmail.com --- /sys/src/cmd/unix/u9fs/u9fs.c Thu Mar 24 16:48:27 2011 +++ /sys/src/cmd/unix/u9fs/u9fs.c Thu Mar 24 16:48:23 2011 @@ -1605,7 +1605,7 @@ return -1; } /* race */ - if(mkdir(npath, perm&0777) < 0){ + if(mkdir(npath, (0400|perm)&0777) < 0){ *ep = strerror(errno); free(npath); return -1;