From: Andrew Deason Date: Mon, 26 Oct 2009 19:04:48 +0000 (-0500) Subject: Dec old special inodes in inode convertROtoRW X-Git-Tag: openafs-devel-1_5_67~106 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=dbe3b7b8eeb4a010f82248befc6167b3b5ed9606;p=packages%2Fo%2Fopenafs.git 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 --- 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); }