Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HFS+ reusable node ID's



At 4:15 PM -0500 1/30/01, John Siracusa wrote:
On 1/30/01 3:01 PM, Markus Silpala wrote:
Mac OS 9.0.4 and earlier, a Node ID is used exactly once per volume per
initialization. When you replace a file in the Finder, the new one keeps its
node ID, and the node ID of the replaced file ceases to exist.

An alias to the old file still works because the alias record also holds path
information, and falls back on that if the old node ID doesn't exist anymore.
I wouldn't expect that to break in Mac OS X.

Well, that depends on your definition of "break", since node IDs are now
being reused.

What I meant was that the mechanism by which an alias of a replaced item resolved to the replacing item wouldn't likely break, despite the old node ID not transferring to the new item.

And according to email@hidden:

On 1/29/01 1:29 PM, Mark Day (email@hidden) wrote:
Note that it is possible to construct scenarios where a node ID is
reused immediately, when you happen to delete an object whose ID
happens to be the next value that will be used.

If a node ID is reused immediately and an alias was pointing to that node
ID, what happens when you follow that alias?

I don't recall the exact alias-resolving logic, but I believe a Finder alias gets its node ID updated any time it's used (someone correct me if I'm wrong). So if the alias got followed just once between the file being replaced and the node ID being reused, the problem would go away. What about your case where the ID just happens to get reused immediately? I don't know, but at this point I'm not terribly worried about it.

It's technically possible for node IDs to be reused, but it simply won't happen on at least 99.999% of all systems, because they'll never use up an entire UInt32 of IDs. Even on the tiny number of systems where it does happen, the chances would be smaller yet that a reused ID just happened to correspond with the ID in an alias record that was still in use, but hadn't been used since the file replacement.

Wading even deeper into speculation, I'd say that a system that rolls its node ID counter is probably going to be a VERY busy server which is not used directly by humans very often. That reduced use translates into fewer aliases being used, or if they are used, them being used regularly and their targets not being deleted or replaced all that often--all of which adds up to even lower odds of the problem occurring.

So while the case above is theoretically possible, the odds of it actually happening in the real world seem akin to the odds of a cosmic ray or static discharge flipping a bit and causing the same symptom.

Of course, the ultra-fast Mac of tomorrow might prove me overly optimistic. ;-)

Has anyone heard of an actual case where an HFS+ volume used up all 0xFFFFFFFF node IDs? I vaguely remember discussion about it last summer, but don't think anyone had actually seen it.

Markus


References: 
 >Re: HFS+ reusable node ID's (From: John Siracusa <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.