From edb398d7d9ac4cfad246401bdfa082a7bd43ecce Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Sun, 10 Aug 1997 14:19:13 +0000 Subject: [PATCH] If, in a level N dump, the file with the inode number X is a non-directory file with more than one link to it, but in a level M > N dump, the file with the inode number X is a plain file, "restore", when restoring the level M dump, won't remove all the hard links to the old file. Submitted by: guy@netapp.com (Guy Harris) --- sbin/restore/restore.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sbin/restore/restore.c b/sbin/restore/restore.c index 936d857d8b5..4da97f144a8 100644 --- a/sbin/restore/restore.c +++ b/sbin/restore/restore.c @@ -428,8 +428,12 @@ nodeupdates(name, ino, type) } if (ip->e_type == LEAF) { /* changing from leaf to node */ - removeleaf(ip); - freeentry(ip); + for (ip = lookupino(ino); ip != NULL; ip = ip->e_links) { + if (ip->e_type != LEAF) + badentry(ip, "NODE and LEAF links to same inode"); + removeleaf(ip); + freeentry(ip); + } ip = addentry(name, ino, type); newnode(ip); } else {