TECHNICAL INFORMATION DOCUMENT TITLE: PTF221 - Simultaneous Server file ops fix DOCUMENT ID: TID300160 DOCUMENT REVISION: B DATE: 25JAN95 ALERT STATUS: Yellow INFORMATION TYPE: Symptom Solution README FOR: PTF221 PRODUCT and VERSION: UnixWare 1.1 ABSTRACT: This file contains PTF221 - Simultaneous file ops fix. This ptf fixes a failure that occurs when several child processes attempt to do simultaneous file operations to the same server. With this ptf, the system now assigns a unique number between 2 and 255 to each transaction stream. This patch should be installed on all UnixWare 1.1.1 and UnixWare 1.1.2 systems that exhibit errors when doing several simultaneous file operations to the same server. SYMPTOM This failure is caused by common task numbers being assigned to each child's ncp transaction stream. The first EOJ in the transaction stream will cause the server to invalidate that task number number, and any further file operations will be failed with a NWERR_INVALID_FILE_HANDLE (88). SOLUTION Apply the ptf221 file. Installation Instructions: DATATYPE: datastream 1. Download the ptf221.Z and ptf221.txt files to the /tmp directory on your machine. 2. Read the release notes contained in this file and follow the instuctions to add the packages to your system. 3. Now become root, uncompress the file and add the package to your system using the following commands: $ su # uncompress /tmp/ptf221.Z # pkgadd -d /tmp/ptf221 ptf221 Solution Specifics 1. General Description This ptf fixes a failure that occurs when several child processes attempt to do simultaneous file operations to the same server. This failure is caused by common task numbers being assigned to each child's ncp transaction stream. The first EOJ in the transaction stream will cause the server to invalidate that task number number, and any further file operations will be failed with a NWERR_INVALID_FILE_HANDLE (88). With this ptf, the system now assigns a unique number between 2 and 255 to each transaction stream. This ptf also fixes a potential race condition in the close of /dev/nwmp00 that could occasionally cause unexpected errors in NUC transactions with the server. 2. New Features None 3. Software Notes and Recommendations This patch should be installed on all UnixWare 1.1.1 and UnixWare 1.1.2 systems that exhibit errors when doing several simultaneous file operations to the same server. This patch requires UnixWare Update 1.1.1 or Update 1.1.2 to be installed on the system. The package will NOT install if the required system configuration is not present. 4. Hardware Notes and Recommendations None 5. Installation Instructions Depending on the format: If this PTF was delivered on a diskette, then (as "root") pkgadd -d diskette1 should install this patch. Otherwise, if you have a file such as "ptf221" which is in a "stream" format, then (as "root") pkgadd -d /ptf221 will work. After installing this patch, a system reboot will be needed to rebuild the kernel and incorporate the updated driver(s). 6. Troubleshooting This test routine demonstrates the environment that causes the failure to occur. /* cc -o test test.c -lnwapi -lsocket -lnsl */ #include #include #include main() { FILE *f; char buf[8192], path[50]; int i,count,ccode; uint16 ConnID; NWPath_t pathID; NWFileHandle_ta FileHandle; uint32 WriteOffset; for (i=0;i<10;i++) { if (fork() == 0) { /* Find the connection ID --- we are already logged in */ ccode = NWGetServerConnID("some-server",&ConnID); if (ccode != 0) { printf("Error getting ConnID (4)\n", NWErrno); exit(0); } sprintf(path,"SYS:/USERS/JDOE/134666412.TMP", getpid()); pathID.pathName = path; pathID.dirHandle = 0; pathID.serverConnID = ConnID; /* Make the file - works fine */ ccode = NWCreateFile(&pathID, NWFA_NORMAL, FileHandle); if (ccode != 0) { printf("(%d) Create Error (%x)\n", i, NWErrno); exit(0); } /* Wait for other processes to catch up */ sleep(2); WriteOffset = 0; /* Try and write some stuff to the file */ ccode = NWWriteFile(ConnID, FileHandle, &WriteOffset, 512, buf); if (ccode != 0) { printf("(%d) Write Error (%x)\n", i, NWErrno); exit(0); } NWCloseFile(ConnID, FileHandle); exit(0); } while (wait(NULL) > 0); /* Wait for the kiddies to finish */ } }