Re: [Take II] Eliminating symlink recursion

Marc Aurele La France (Marc.La-France@ualberta.ca)
Wed, 19 Jun 1996 09:25:38 -0600 (MDT)


On Tue, 18 Jun 1996, Kjetil Torgrim Homme wrote:

> Excuse me, I do not understand why this logic is useful.

> Since you put in a threshold (and I think you were right in adding
> it), you can not make arbitrarily complex, but correct webs of
> symlinks. So you lose the generality you had before.

Not entirely, the new limit can be changed or even disabled at compile
time, presumably by the sys admin.

> So, the benefit is then that you can detect loops before the threshold
> is reached. However, it looks like the overheads are very high, and I
> would be surprised if it was a win even for the simple case (which
> gives the greatest gain).

Well, given the linear search I use to find duplicates, I would expect
that resolving a pathname to an inode is O(n^3), where n is the number of
symlinks that need to be followed. This could be improved, I suppose.
Worst-case memory requirements, however, are O(n).

Marc.

+----------------------------------+-----------------------------------+
| Marc Aurele La France | work: 1-403-492-9310 |
| Computing and Network Services | fax: 1-403-492-1729 |
| 352 General Services Building | email: tsi@ualberta.ca |
| University of Alberta +-----------------------------------+
| Edmonton, Alberta | |
| T6G 2H1 | Standard disclaimers apply |
| CANADA | |
+----------------------------------+-----------------------------------+