[435] in Athena Bugs

home help back first fref pref prev next nref lref last post

A bug with attach

daemon@ATHENA.MIT.EDU (John Carr)
Thu Jun 9 01:20:23 1988

To: bugs@ATHENA.MIT.EDU
Date: Thu, 09 Jun 88 01:19:38 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>
Program with which you had the problem: attach

Name of person who discovered the bug: John Carr
Their MIT phone number: 5-6155
Their Athena Login ID: jfc
------------------------------------------------------------------------
A brief synopsis of the problem:

Due to the order in which attach performs its operations, it is possible
for attach to silently fail, leaving an entry in /etc/attachtab without
attaching the filesystem.

------------------------------------------------------------------------
Please describe the problem in detail:
(5.5T, RT and Vax)

As far as I can tell, attach does things in the following order:
  1. creates a mount point immediately
  2: creates the attachtab entry, THEN
  3: checks for mount point busy.
if all is OK, then
  4: mounts filesystem
else
  4: deletes mount point
In either case:
  5: print success message

This allows the following bug:

You will need two windows.  In one, attach a filesystem.  Immediately
in the other, cd to the mount point (already created, an empty directory).
Wait.  The attach job will print out the usual success message.  There will
be an entry in /etc/attachtab.   The filesystem will NOT be attached (df
will not find it).  The mount point will have been deleted.  The shell in 
the mount point is now upset because "." is gone.  

Transcript of example:
   window 1                                      window 2

% attach sgs                               
                                            % cd /mit/sgs
                                            % ls -l
                                            total 0
sgs: NFS mounted [...] on /mit/sgs [...]    
                                            % ls -l
                                            . not found
% detach sgs                               
/mit/sgs: No such file or directory        
Can't unmount sgs.                         
%                                       
   
At this point there is still an attachtab entry.

The same thing seems to happen if an existing filesystem is specified
as the argument to -m.  
------------------------------------------------------------------------
Fix (if you know what it is):

Delay creation of mount point as long as possible, to lessen chance of
its being in use.

Print error messages and delete attachtab entry on failure.

home help back first fref pref prev next nref lref last post