From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <1a6cb4cfd1c284bb6b0206a0c0e11b0c@rei2.9hal> Date: Mon, 25 Feb 2013 06:55:35 +0100 From: cinap_lenrek@gmx.de To: 9fans@9fans.net In-Reply-To: <98CF3C6D-984B-4FE7-A434-EDCCA80255DD@ar.aichi-u.ac.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] curious mtime of cwfs Topicbox-Message-UUID: 1e91e20a-ead8-11e9-9d60-3106f5b1d025 yes. very good observation. the following change fixes it for me (with added comments) term% hg diff -r 1763 cw.c diff -r 5229de0742e8 sys/src/cmd/cwfs/cw.c --- a/sys/src/cmd/cwfs/cw.c Tue Jul 24 19:42:18 2012 +0200 +++ b/sys/src/cmd/cwfs/cw.c Mon Feb 25 06:30:55 2013 +0100 @@ -1557,14 +1557,13 @@ d1->uid = d->uid; d1->gid = d->gid; putbuf(p); - accessdir(p1, d1, FWRITE, 0); <- was modifying yyyy direcoty in case when added, will do below instead + accessdir(pr, dr, FWRITE, 0); <- update mtime of dumproot as we added yyyy directory /* * put mmdd[count] in year directory */ found2: - accessdir(p1, d1, FREAD, 0); <- was updating atime of yyyy direcotory in case when it was already present. this is not needed as we'r going to always update both atime and mtime below - p1->flags |= Bmod; /* noatime */ + accessdir(pr, dr, FREAD, 0); <- update atime of dumproot only as we didnt add a new yyyy direcotory putbuf(pr); pr = p1; <- yyyy directory become pr/dr dr = d1; @@ -1603,6 +1602,7 @@ d1->qid.version += n; accessdir(p1, d1, FWRITE, 0); <- update dump sub directory times putbuf(p1); + accessdir(pr, dr, FWRITE, 0); <- now update atime and mtime of yyyy directory after creating dump sub directory in it putbuf(pr); cw->fsize = cwsize(cw->dev); the problem was that we only updated mtime of the yyyy directory when we newly created it, otherwise only access time was updated. but we *always* have to update mtime of the yyyy directory because we are modifying it by creating the dump sub directory in it. -- cinap