Messages in this thread Patch in this message | | | Date | Sun, 26 Jul 1998 12:31:15 -0300 | From | Sean Garagan <> | Subject | Re: Slow UltraDMA using tar |
| |
The problem was identified by Emmanuel Galanos. He noted that tar was not handling caching of unknown uid/gid in the tarball properly. The reason I had first suspected a problem with the disk is that I hadn't noticed this problem until I had upgraded to an UltraDMA drive with glibc-2. I ran a test using the apache source and came up with 2:11 minutes for the original source (which has uids unknown to my system). Using a tarball I made with valid UIDs gave just a few seconds.
The patch for tar 1.12 he sent me is as follows:
--- tar-1.12/src/names.c.orig Fri Oct 31 11:58:55 1997 +++ tar-1.12/src/names.c Fri Feb 6 04:09:46 1998 @@ -48,6 +48,9 @@ static uid_t cached_uid; /* valid only if cached_uname is not empty */ static gid_t cached_gid; /* valid only if cached_gname is not empty */
+static int good_uname; /* cached uname exists */ +static int good_gname; /* cached gname exists */ + /*------------------------------------------. | Given UID, find the corresponding UNAME. | `------------------------------------------*/ @@ -109,16 +112,20 @@ || strncmp (uname, cached_uname, UNAME_FIELD_SIZE) != 0) { passwd = getpwnam (uname); + strncpy (cached_uname, uname, UNAME_FIELD_SIZE); if (passwd) { cached_uid = passwd->pw_uid; - strncpy (cached_uname, uname, UNAME_FIELD_SIZE); + good_uname=1; + } + else + { + good_uname=0; + return 0; } - else - return 0; } - *uidp = cached_uid; - return 1; + if (good_uname) *uidp = cached_uid; + return good_uname; }
/*-------------------------------------------------------------------------. @@ -135,16 +142,20 @@ || strncmp (gname, cached_gname, GNAME_FIELD_SIZE) != 0) { group = getgrnam (gname); + strncpy (cached_gname, gname, GNAME_FIELD_SIZE); if (group) { cached_gid = group->gr_gid; - strncpy (cached_gname, gname, GNAME_FIELD_SIZE); + good_gname = 1; } else - return 0; + { + good_gname = 0; + return 0; + } } - *gidp = cached_gid; - return 1; + if (good_gname) *gidp = cached_gid; + return good_gname; } ^L /* Names from the command call. */
On Sun, Jul 26, 1998 at 04:20:55PM +0100, Alan Cox wrote: > > > Umm, had you been reading the mailing list more often, you'd know that > > > DMA is now disabled by default. > > > > Hrm, I think thats only on 2.1.111, I might be worng tho.. > > On 2.0.x as he is using Ultra DMA, and IDE DMA in general is enabled by > default and reliable. > > Alan
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html
| |