9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] cifs buglet - take 2
@ 2019-02-05 17:10 cinap_lenrek
  2019-02-05 17:26 ` Steve Simon
  0 siblings, 1 reply; 4+ messages in thread
From: cinap_lenrek @ 2019-02-05 17:10 UTC (permalink / raw)
  To: 9fans

thanks!

> 		while(got > 0 && strcmp(fi[0].name, ".") == 0 || strcmp(fi[0].name, "..") == 0){

that looks like a bug to me. you ment to write the following instead?

 while(got > 0 && (strcmp(fi[0].name, ".") == 0 || strcmp(fi[0].name, "..") == 0)){

--
cinap



^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: [9fans] cifs buglet - take 2
@ 2019-02-05 17:39 cinap_lenrek
  0 siblings, 0 replies; 4+ messages in thread
From: cinap_lenrek @ 2019-02-05 17:39 UTC (permalink / raw)
  To: 9fans

do you have a recent copy arround somewhere?

theres more stuff that needs merging like:

-from_cache:
 	fi = (FInfo *)(a->cache + (off - a->off));
 	npath = smprint("%s/%s", mapfile(a->path), fi->name);
-	I2D(d, a->sp, npath, fi);
+	I2D(d, a->sp, npath, realmtime(npath), fi);

--
cinap



^ permalink raw reply	[flat|nested] 4+ messages in thread
* [9fans] cifs buglet - take 2
@ 2019-02-05 11:58 Steve Simon
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Simon @ 2019-02-05 11:58 UTC (permalink / raw)
  To: 9fans

sorry, I generated the diff on the wrong server, slightly safer fix below

diff /n/dump/2019/0205/sys/src/cmd/cifs/main.c /sys/src/cmd/cifs/main.c
261,265c261,264
< 		if(got >= 2 && strcmp(fi[0].name, ".") == 0 &&
< 		    strcmp(fi[1].name, "..") == 0){
< 			a->end = (got - 2) * sizeof(FInfo);
< 			memmove(a->cache, a->cache + sizeof(FInfo)*2,
< 				a->end - a->off);
---
> 		while(got > 0 && strcmp(fi[0].name, ".") == 0 || strcmp(fi[0].name, "..") == 0){
> 			got--;
> 			a->end = got * sizeof(FInfo);
> 			memmove(a->cache, a->cache + sizeof(FInfo), a->end - a->off);

-Steve



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-05 17:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-05 17:10 [9fans] cifs buglet - take 2 cinap_lenrek
2019-02-05 17:26 ` Steve Simon
  -- strict thread matches above, loose matches on Subject: below --
2019-02-05 17:39 cinap_lenrek
2019-02-05 11:58 Steve Simon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).