From 4a70653b22b1f5b2565d0eea353713f29b21212d Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Mon, 26 Oct 2009 14:04:48 -0500 Subject: [PATCH] Dec old special inodes in inode convertROtoRW The convertROtoRW code for the inode fileserver makes copies of the volume's special inodes, but leaves the old (RO) inodes around. If the RO is created again, this will result in duplicate special inodes for the same volume, which freaks out the salvager (and possibly other things). So IH_DEC the old RO special inodes after converting, so they go away. Reviewed-on: http://gerrit.openafs.org/735 Tested-by: Andrew Deason Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear (cherry picked from commit dbe3b7b8eeb4a010f82248befc6167b3b5ed9606) Change-Id: Id545befbb38f60c262ab23b5eb5dd54439008760 Reviewed-on: http://gerrit.openafs.org/761 Tested-by: Andrew Deason Reviewed-by: Derrick Brashear --- src/vol/listinodes.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/vol/listinodes.c b/src/vol/listinodes.c index ccc7ef288..55a3d0a3c 100644 --- a/src/vol/listinodes.c +++ b/src/vol/listinodes.c @@ -1739,6 +1739,14 @@ inode_ConvertROtoRWvolume(char *pname, afs_int32 volumeId) FDH_CLOSE(fdP); FDH_CLOSE(fdP2); + + /* Unlink the old special inode; otherwise we will get duplicate + * special inodes if we recreate the RO again */ + if (IH_DEC(ih, specinos[j].inodeNumber, volumeId) == -1) { + Log("IH_DEC failed: %x, %s, %u errno %d\n", ih, + PrintInode(NULL, specinos[j].inodeNumber), volumeId, errno); + } + IH_RELEASE(ih); IH_RELEASE(ih2); } -- 2.39.5