From dbe3b7b8eeb4a010f82248befc6167b3b5ed9606 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. Change-Id: Ifefa2cb69c5b2960b81dbee9d54e5ea8401b240e Reviewed-on: http://gerrit.openafs.org/735 Tested-by: Andrew Deason Tested-by: Derrick Brashear 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 9cbaaa2b0..54ff779a5 100644 --- a/src/vol/listinodes.c +++ b/src/vol/listinodes.c @@ -1531,6 +1531,14 @@ inode_ConvertROtoRWvolume(char *pname, afs_uint32 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