[63] in The Cryptographic File System users list
Re: Annoying CFS bug fixed
daemon@ATHENA.MIT.EDU (Stephen D. Williams)
Sun Apr 26 13:00:18 1998
From owner-cfs-users@research.att.com Sun Apr 26 17:00:17 1998
Return-Path: <owner-cfs-users@research.att.com>
Delivered-To: cfs-mtg@bloom-picayune.mit.edu
Received: (qmail 26717 invoked from network); 26 Apr 1998 17:00:14 -0000
Received: from unknown (HELO ns.research.att.com) (192.20.225.4)
by bloom-picayune.mit.edu with SMTP; 26 Apr 1998 17:00:14 -0000
Received: from research.att.com ([135.207.30.100]) by ns; Sun Apr 26 12:59:12 EDT 1998
Received: from amontillado.research.att.com ([135.207.24.32]) by research-clone; Sun Apr 26 12:47:15 EDT 1998
Received: from nsa.research.att.com (majordomo@nsa.research.att.com [135.207.24.155])
by amontillado.research.att.com (8.8.7/8.8.7) with ESMTP id MAA26994;
Sun, 26 Apr 1998 12:47:14 -0400 (EDT)
Received: (from majordomo@localhost) by nsa.research.att.com (8.7.3/8.7.3) id MAA25184 for cfs-users-list; Sun, 26 Apr 1998 12:44:55 -0400 (EDT)
X-Authentication-Warning: nsa.research.att.com: majordomo set sender to owner-cfs-users@nsa.research.att.com using -f
Received: from research.att.com (research-clone.research.att.com [135.207.30.100]) by nsa.research.att.com (8.7.3/8.7.3) with SMTP id MAA25180 for <cfs-users@nsa.research.att.com>; Sun, 26 Apr 1998 12:44:52 -0400 (EDT)
Received: from lig.net ([204.248.145.100]) by research-clone; Sun Apr 26 12:46:42 EDT 1998
Received: from lig.net (207-172-77-120.s57.as2.lee.erols.com [207.172.77.120])
by lig.net (8.8.5/8.8.5) with ESMTP id MAA03743;
Sun, 26 Apr 1998 12:50:32 -0400
Message-ID: <35436617.A797A9DD@lig.net>
Date: Sun, 26 Apr 1998 12:51:35 -0400
From: "Stephen D. Williams" <sdw@lig.net>
Reply-To: sdw@lig.net
Organization: Concinnous Consulting, Inc.
X-Mailer: Mozilla 4.04 [en] (Win95; U)
MIME-Version: 1.0
To: Sean Sheedy <seans@easystreet.com>
CC: cfs-users@research.att.com
Subject: Re: Annoying CFS bug fixed
References: <354241DB.18207160@firefly.rain.com>
Content-Type: multipart/mixed; boundary="------------44F6111CA866B76A11F9B6DA"
Sender: owner-cfs-users@research.att.com
Precedence: bulk
This is a multi-part message in MIME format.
--------------44F6111CA866B76A11F9B6DA
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Thanks!
Whoops, please ignore my previous message asking for this... ;-)
sdw
Sean Sheedy wrote:
> The current version of CFS has a bug where the modification time is
> changed on the file even if it is opened only for read. I've attached a
> patch to fix this bug. Also, this patch has a change to avoid an
> unnecessary truncate when the file isn't actually shrinking.
>
> Sean
>
> --
> Sean Sheedy seans@easystreet.com
>
> Every decent man is ashamed of the government he lives under.
> -- H.L. Mencken
>
> ------------------------------------------------------------------------
> *** cfs_fh.c 1998/01/02 07:12:25 1.1
> --- cfs_fh.c 1998/03/14 00:18:10
> ***************
> *** 547,553 ****
> openfd=NULL;
> }
>
> ! if (mode==0) { mode=CFS_WRITE; }
> /* Phil Karn's hack for R/O file systems */
> if ((fd=open(f->name,mode,0))<0 && errno == EROFS) {
> mode = CFS_READ; /* Force read and try again */
> --- 547,554 ----
> openfd=NULL;
> }
>
> ! /* ### This looks badly wrong */
> ! /* if (mode==0) { mode=CFS_WRITE; } */
> /* Phil Karn's hack for R/O file systems */
> if ((fd=open(f->name,mode,0))<0 && errno == EROFS) {
> mode = CFS_READ; /* Force read and try again */
> ***************
> *** 669,678 ****
> if (utimes(f->name,tv)<0)
> return -1;
> }
> ! if (((int)a->size) >= 0)
> ! if (truncate(f->name,vtod(a->size)))
> ! if (errno != EISDIR)
> ! return 0;
> /* printf("fhsetattr: atime=%x,%x mtime=%x,%x\n",
> a->atime.seconds, a->atime.useconds,
> a->mtime.seconds, a->mtime.useconds); */
> --- 670,683 ----
> if (utimes(f->name,tv)<0)
> return -1;
> }
> ! if (((int)a->size) >= 0) {
> ! struct stat sbuf;
> !
> ! if (stat(f->name, &sbuf) == 0 && a->size < sbuf.st_size)
> ! if (truncate(f->name,vtod(a->size)))
> ! if (errno != EISDIR)
> ! return 0;
> ! }
> /* printf("fhsetattr: atime=%x,%x mtime=%x,%x\n",
> a->atime.seconds, a->atime.useconds,
> a->mtime.seconds, a->mtime.useconds); */
--
Stephen D. Williams 25Feb1965 VW,OH (FBI ID) sdw@lig.net
http://www.lig.net/sdw
Consultant, Vienna,VA Mar95- 703-724-0118W 43392 Wayside Cir.,Ashburn, VA
20147
SC:AOL; CTO:Netword LLC 703-995-0407Fax
OO/Unix/Comm/Video/DBMS
Pres.:Concinnous Consulting,Inc.;SDW Systems;Local Internet Gateway
Co.1Mar1998
--------------44F6111CA866B76A11F9B6DA
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Stephen Williams
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Stephen Williams
n: Williams;Stephen
org: Concinnous Consulting, Inc.
adr: 43392 Wayside Circle;;;Ashburn;VA;20147;US
email;internet: sdw@lig.net
title: Senior Consultant/President
tel;work: 703-724-0118
tel;fax: 703-995-0407
tel;home: 703-729-5405
note: Resume at: http://sdw.st
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
version: 2.1
end: vcard
--------------44F6111CA866B76A11F9B6DA--