We are running an MR-AFS fileserver under AIX 4.1. Since the MR-AFS 
source is based on AFS 3.3a I had to include the changes for AIX 4.1 
from standard AFS 3.4a. The changes in src/vol/listinodes.c are not 
sufficient to allow the salvager to read the inodes from the raw device 
correctly, if you don't have created the filesystem with the default 
values for bytes/inode and fragment-size. 

The fields s_iagsize and s_fragsize should be interpreted!!!

If you don't do that you may damage your volumes and loose files.

The changes I made are the following:

some global variables

#ifdef AFS_AIX41_ENV
        int fragsize;
        int iagsize;
        int ag512;
        int agblocks;
#endif /* AFS_AIX41_ENV */

Then in ListViceInodes()

#ifdef AFS_AIX41_ENV
        fragsize = (fs.s_fragsize)? fs.s_fragsize : FSBSIZE;
        iagsize = (fs.s_iagsize)? fs.s_iagsize : fs.s_agsize;
        ag512 = fragsize * fs.s_agsize / 512;
        agblocks = fragsize * fs.s_agsize >> BSHIFT;
#endif /* AFS_AIX41_ENV */

and later

#ifdef AFS_AIX41_ENV
        imax = iagsize * (fs.s_fsize/ag512) -1;
#else /* AFS_AIX41_ENV */
        imax = ((fmax / fs.s_agsize +
                 ((fmax % fs.s_agsize) >= fs.s_agsize/INOPB ? 1 : 0))
                * fs.s_agsize) - 1;
#endif /* AFS_AIX41_ENV */

and in ginode()

#ifdef AFS_AIX41_ENV
        ag   = inum / iagsize;
        pblk = (ag == 0) ? INODES_B + inum/INOPB
                : ag*agblocks + (inum - ag*iagsize)/INOPB;
#else /* AFS_AIX41_ENV */
        ag   = inum / fs.s_agsize;
        pblk = (ag == 0) ? INODES_B + inum/INOPB
                : ag*fs.s_agsize + (inum - ag*fs.s_agsize)/INOPB;
#endif /* AFS_AIX41_ENV */

I hope Transarc did not make the same mistakes in v3fshelper!!!

Hartmut Reuter
-----------------------------------------------------------------
Hartmut Reuter                           e-mail [EMAIL PROTECTED]
                                           phone +49-89-3299-1328
RZG (Rechenzentrum Garching)               fax   +49-89-3299-1301 
Computing Center of the Max-Planck-Gesellschaft (MPG) and the
Institut fuer Plasmaphysik (IPP)
-----------------------------------------------------------------

Reply via email to