From 1e31d335d21ff34c668e460ff60b71792db1e2b4 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Mon, 10 Jun 2002 12:02:03 +0000 Subject: [PATCH] Merge changes for 1.2.5 --- src/afs/afs_call.c | 9 ++++----- src/afs/afs_pioctl.c | 5 +++-- src/libafs/Makefile.common | 9 +++++++++ src/libafs/MakefileProto.LINUX.in | 11 +---------- src/viced/afsfileprocs.c | 33 +++++++++++++++++++++++++++++-- 5 files changed, 48 insertions(+), 19 deletions(-) diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index b9fea5a8f..e31a7604f 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -10,7 +10,7 @@ #include #include "../afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_call.c,v 1.11 2002/05/12 05:50:41 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_call.c,v 1.12 2002/06/10 12:02:02 hartmans Exp $"); #include "../afs/sysincludes.h" /* Standard vendor system headers */ #include "../afs/afsincludes.h" /* Afs-based standard headers */ @@ -544,10 +544,9 @@ long parm, parm2, parm3, parm4, parm5, parm6; #endif afs_cold_shutdown = 0; if (parm == 1) afs_cold_shutdown = 1; - if (afs_globalVFS != 0) { - afs_warn("AFS isn't unmounted yet! Call aborted\n"); - code = EACCES; - } + if (afs_globalVFS != 0) + afs_warn("AFS isn't unmounted yet!\n"); + afs_shutdown(); } diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index bcb386192..038108363 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -10,7 +10,7 @@ #include #include "../afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_pioctl.c,v 1.12 2002/05/12 05:50:42 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_pioctl.c,v 1.13 2002/06/10 12:02:03 hartmans Exp $"); #include "../afs/sysincludes.h" /* Standard vendor system headers */ #include "../afs/afsincludes.h" /* Afs-based standard headers */ @@ -1414,7 +1414,8 @@ static PGCPAGs(avc, afun, areq, ain, aout, ainSize, aoutSize, acred) memcpy((char *)&flag, ain, sizeof(afs_int32)); /* primary id flag */ ain += sizeof(afs_int32); /* skip id field */ /* rest is cell name, look it up */ - if (flag & 0x8000) { /* XXX Use Constant XXX */ + /* some versions of gcc appear to need != 0 in order to get this right */ + if (flag & 0x8000 != 0) { /* XXX Use Constant XXX */ flag &= ~0x8000; set_parent_pag = 1; } diff --git a/src/libafs/Makefile.common b/src/libafs/Makefile.common index 9f1afd2ac..d3c68d1cc 100644 --- a/src/libafs/Makefile.common +++ b/src/libafs/Makefile.common @@ -91,7 +91,9 @@ AFSAOBJS = \ afs_volume.o \ afsaux.o \ Kvice.xdr.o \ + xdr_array.o \ xdr_arrayn.o \ + xdr_int64.o \ Kvice.cs.o \ fcrypt.o \ rx.o \ @@ -118,6 +120,7 @@ AFSAOBJS = \ rxkad_client.o \ rxkad_common.o \ xdr_afsuuid.o \ + xdr.o \ afs_uuid.o $(AFS_OS_OBJS) # These next two allow nfs and nonfs builds to occur in the same directory. @@ -307,6 +310,12 @@ afsaux.o: $(AFSINT)/afsaux.c $(CRULE1); xdr_arrayn.o: $(RX)/xdr_arrayn.c $(CRULE1); +xdr_array.o: $(RX)/xdr_array.c + $(CRULE1); +xdr_int64.o: $(RX)/xdr_int64.c + $(CRULE1); +xdr.o: $(RX)/xdr.c + $(CRULE1); Kvldbint.cs.o: $(AFSINT)/Kvldbint.cs.c $(CRULE1); Kvldbint.xdr.o: $(AFSINT)/Kvldbint.xdr.c diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in index 3e51e79f6..f983e12b0 100644 --- a/src/libafs/MakefileProto.LINUX.in +++ b/src/libafs/MakefileProto.LINUX.in @@ -42,10 +42,7 @@ AFS_OS_OBJS = \ osi_sysctl.o \ osi_vfsops.o \ osi_vm.o \ - osi_vnodeops.o \ - xdr.o \ - xdr_array.o \ - xdr_int64.o + osi_vnodeops.o AFS_OS_NFSOBJS = @@ -310,9 +307,3 @@ osi_vm.o: $(AFS)/osi_vm.c $(CRULE1) osi_vnodeops.o: $(AFS)/osi_vnodeops.c $(CRULE1) -xdr.o: $(RX)/xdr.c - $(CRULE1) -xdr_int64.o: $(RX)/xdr_int64.c - $(CRULE1) -xdr_array.o: $(RX)/xdr_array.c - $(CRULE1) diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 77d82b03d..78dc7cedd 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -28,7 +28,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/viced/afsfileprocs.c,v 1.8 2002/05/12 05:50:44 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/viced/afsfileprocs.c,v 1.9 2002/06/10 12:02:03 hartmans Exp $"); #include #include @@ -1715,6 +1715,7 @@ SAFSS_RemoveFile (tcon, DirFid, Name, OutDirStatus, Sync) struct client *t_client; /* tmp ptr to client data */ struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ + FidZero(&dir); /* Get ptr to client data for user Id for logging */ t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); logHostAddr.s_addr = rx_HostOf(rx_PeerOf(tcon)); @@ -1783,6 +1784,7 @@ SAFSS_RemoveFile (tcon, DirFid, Name, OutDirStatus, Sync) Bad_RemoveFile: /* Update and store volume/vnode and parent vnodes back */ PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr, volptr); + FidZap(&dir); ViceLog(2, ("SAFS_RemoveFile returns %d\n", errorCode)); return errorCode; @@ -1877,6 +1879,8 @@ SAFSS_CreateFile (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus, struct client *t_client; /* tmp ptr to client data */ struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ + FidZero(&dir); + /* Get ptr to client data for user Id for logging */ t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); logHostAddr.s_addr = rx_HostOf(rx_PeerOf(tcon)); @@ -1944,6 +1948,7 @@ SAFSS_CreateFile (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus, Bad_CreateFile: /* Update and store volume/vnode and parent vnodes back */ PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr, volptr); + FidZap(&dir); ViceLog(2, ("SAFS_CreateFile returns %d\n", errorCode)); return errorCode; @@ -2055,6 +2060,11 @@ SAFSS_Rename (tcon, OldDirFid, OldName, NewDirFid, NewName, OutOldDirStatus, struct client *t_client; /* tmp ptr to client data */ struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ + FidZero(&olddir); + FidZero(&newdir); + FidZero(&filedir); + FidZero(&newfiledir); + /* Get ptr to client data for user Id for logging */ t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); logHostAddr.s_addr = rx_HostOf(rx_PeerOf(tcon)); @@ -2404,6 +2414,10 @@ Bad_Rename: } PutVolumePackage(fileptr, (newvptr && newvptr != oldvptr? newvptr : 0), oldvptr, volptr); + FidZap(&olddir); + FidZap(&newdir); + FidZap(&filedir); + FidZap(&newfiledir); ViceLog(2, ("SAFS_Rename returns %d\n", errorCode)); return errorCode; @@ -2503,6 +2517,8 @@ SAFSS_Symlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus, struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ FdHandle_t *fdP; + FidZero(&dir); + /* Get ptr to client data for user Id for logging */ t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); logHostAddr.s_addr = rx_HostOf(rx_PeerOf(tcon)); @@ -2594,6 +2610,7 @@ SAFSS_Symlink (tcon, DirFid, Name, LinkContents, InStatus, OutFid, OutFidStatus, Bad_SymLink: /* Write the all modified vnodes (parent, new files) and volume back */ PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr, volptr); + FidZap(&dir); ViceLog(2, ("SAFS_Symlink returns %d\n", errorCode)); return errorCode; @@ -2690,6 +2707,8 @@ SAFSS_Link (tcon, DirFid, Name, ExistingFid, OutFidStatus, OutDirStatus, Sync) struct client *t_client; /* tmp ptr to client data */ struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ + FidZero(&dir); + /* Get ptr to client data for user Id for logging */ t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); logHostAddr.s_addr = rx_HostOf(rx_PeerOf(tcon)); @@ -2794,6 +2813,7 @@ SAFSS_Link (tcon, DirFid, Name, ExistingFid, OutFidStatus, OutDirStatus, Sync) Bad_Link: /* Write the all modified vnodes (parent, new files) and volume back */ PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr, volptr); + FidZap(&dir); ViceLog(2, ("SAFS_Link returns %d\n", errorCode)); return errorCode; @@ -2894,6 +2914,9 @@ SAFSS_MakeDir (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus, struct client *t_client; /* tmp ptr to client data */ struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ + FidZero(&dir); + FidZero(&parentdir); + /* Get ptr to client data for user Id for logging */ t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); logHostAddr.s_addr = rx_HostOf(rx_PeerOf(tcon)); @@ -2964,7 +2987,7 @@ SAFSS_MakeDir (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus, Update_TargetVnodeStatus(targetptr, TVS_MKDIR, client, InStatus, parentptr, volptr, 0); - /* Actually create the New directory in the directory package */ + /* Actually create the New directory in the directory package */ SetDirHandle(&dir, targetptr); assert(!(MakeDir(&dir, OutFid, DirFid))); DFlush(); @@ -2987,6 +3010,8 @@ SAFSS_MakeDir (tcon, DirFid, Name, InStatus, OutFid, OutFidStatus, Bad_MakeDir: /* Write the all modified vnodes (parent, new files) and volume back */ PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr, volptr); + FidZap(&dir); + FidZap(&parentdir); ViceLog(2, ("SAFS_MakeDir returns %d\n", errorCode)); return errorCode; @@ -3082,6 +3107,8 @@ SAFSS_RemoveDir (tcon, DirFid, Name, OutDirStatus, Sync) struct client *t_client; /* tmp ptr to client data */ struct in_addr logHostAddr; /* host ip holder for inet_ntoa */ + FidZero(&dir); + /* Get ptr to client data for user Id for logging */ t_client = (struct client *) rx_GetSpecific(tcon, rxcon_client_key); logHostAddr.s_addr = rx_HostOf(rx_PeerOf(tcon)); @@ -3146,6 +3173,7 @@ SAFSS_RemoveDir (tcon, DirFid, Name, OutDirStatus, Sync) Bad_RemoveDir: /* Write the all modified vnodes (parent, new files) and volume back */ PutVolumePackage(parentwhentargetnotdir, targetptr, parentptr, volptr); + FidZap(&dir); ViceLog(2, ("SAFS_RemoveDir returns %d\n", errorCode)); return errorCode; @@ -6572,6 +6600,7 @@ int CopyOnWrite(targetptr, volptr) ViceLog(0,("CopyOnWrite failed: volume %u in partition %s (tried reading %u, read %u, wrote %u, errno %u) volume needs salvage\n", V_id(volptr), volptr->partition->name, length, rdlen, wrlen, errno)); + assert(0); /* Decrement this inode so salvager doesn't find it. */ FDH_REALLYCLOSE(newFdP); IH_RELEASE(newH); -- 2.39.5