commit a6036d0f379802f758a29f876bfade2bd53a3c40 from: Omar Polo date: Tue Dec 21 17:04:57 2021 UTC ensure that a walk with zero paths don't replies with a qid A walk of zero paths is used to duplicate a fid. it doesn't make sense to reply with a body containing the qid relative to the file, because it's not a real walk, it's just a duplication. Furthermore, it would break the expectations that the number of qid returned is less or equal to the walked components. commit - a72c4af60ba6e38d8025562a9f073fd95d163197 commit + a6036d0f379802f758a29f876bfade2bd53a3c40 blob - 5dee77d3c2edb602fb3b668eb6f88ed3472d854f blob + 4241d5adf869284cced71791e2faa7645639ba54 --- client.c +++ client.c @@ -1040,7 +1040,7 @@ twalk(struct np_msg_header *hdr, const uint8_t *data, if (nf == NULL && (nf = new_fid(f->qid, newfid)) == NULL) fatal("new_fid duplication"); - np_walk(hdr->tag, 1, f->qid); + np_walk(hdr->tag, 0, NULL); return; } blob - b916ec1968612dd7186765cffe9e0844c068c637 blob + 382139a46e99c9528b458d83d64e222316f8809d --- regress/walk-suite.9ps +++ regress/walk-suite.9ps @@ -52,3 +52,13 @@ testing "walk with an invalid component" dir "./root" walk(0, 1, "/non-exists") expect-error() } + +testing "zero-path walk don't reply with a qid" dir "./root" { + mount(0, "/") + walk(0, 1) + m = recv() + assert ( + m.type == Rwalk + m.nwqid == 0 + ) +}