summaryrefslogtreecommitdiff
path: root/sys/src/cmd/cwfs/chk.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-06-19 22:58:16 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2019-06-19 22:58:16 +0200
commit159f96c534563f26edeeb227cd00f1bdd3bd2596 (patch)
tree20a396455cad2d59fd677d19a1539d5e531e69ae /sys/src/cmd/cwfs/chk.c
parent8561a843070582d48ef7f99e1138941c3509975f (diff)
cwfs: properly handle 64 bit qid path
for historical reasons, kenfs stores directory entries in pre 9p2000 format with directories having the QPDIR bit 31 set in the qid path. however, the 64 bit fileserver allows 64 bit qid paths. given that we do not support pre 9p2000 clients and do not rely on the QPDIR, but want to keep the block check tags consistent, we will *INVERT* the QPDIR bit in directory entry qid paths for directories. this preserves the on-disk semantics (for < 31 bit qmax) but does not complicate qid generation and recovery. also makes it easy to convert between directory entry qid and 9p format.
Diffstat (limited to 'sys/src/cmd/cwfs/chk.c')
-rw-r--r--sys/src/cmd/cwfs/chk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/src/cmd/cwfs/chk.c b/sys/src/cmd/cwfs/chk.c
index 1b793c69c..c2a4644ee 100644
--- a/sys/src/cmd/cwfs/chk.c
+++ b/sys/src/cmd/cwfs/chk.c
@@ -430,7 +430,9 @@ fsck(Dentry *d)
}
/* check qid */
- edent.qpath = d->qid.path & ~QPDIR;
+ edent.qpath = d->qid.path;
+ if(d->mode & DDIR)
+ edent.qpath ^= QPDIR;
qmark(edent.qpath);
if(edent.qpath > maxq)
maxq = edent.qpath;