From: Andrew Deason Date: Tue, 27 Jul 2010 21:22:47 +0000 (-0500) Subject: salvage: update inodes array after CopyAndSalvage X-Git-Tag: openafs-devel-1_5_76~21 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=219ab91243b8c9c5ffbfa459047968145debee9c salvage: update inodes array after CopyAndSalvage CopyAndSalvage makes a copy of the directory to salvage it. So, the new directory will have a new inode. Update the array of directory inodes to reflect this. Without this, we can fail to alter the copied/salvaged directory later on, since we will try to read/write to the wrong inode. Change-Id: I2466981e8ee54c5aecf1a166a37d8146b126de24 Reviewed-on: http://gerrit.openafs.org/2530 Tested-by: Andrew Deason Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 55bd240..c4ace1d 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -3329,6 +3329,7 @@ SalvageDir(char *name, VolumeId rwVid, struct VnodeInfo *dirVnodeInfo, if (!Testing) { CopyAndSalvage(&dir); dirok = 1; + dirVnodeInfo->inodes[i] = dir.dirHandle.dirh_inode; } } dirHandle = dir.dirHandle;