#302 closed defect (fixed)

fix violation of FS node object copy semantics

Reported by: strauman Owned by: Jennifer Averett
Priority: normal Milestone: 2
Component: fs Version: unknown
Severity: major Keywords:
Cc: bugs@… Blocked By:
Blocking:

Description

According to the FS semantics, the node_access field is private to the FS implementation. Hence, nodes must not simply be copied but 'cloned', i.e. when copying a node, the FS must be given a chance to create a copy of the private information.
Unfortunately, the generics provide no such hook (the 'opposite' of rtems_filesystem_freenode). However, as a workaround, the evalpath() routine can be used for that purpose, as it returns a freshly allocated node. evalpath(".") hence comes close to a copy constructor.

The attached patch fixes the fchdir() and chroot() syscalls so they properly allocate new nodes from the FS.

Note that the 'privateenv' code heavily violates the FS node_access ownership paradigm. I have fixes for 'privateenv' also but IMO, that entire code needs to be revised.
The current/root locations should be thread-based
by default because the manipulation of 'current' introduces race conditions. I'll file a separate PR for the privateenv related stuff.

Release:
ss-20020301

Attachments (1)

nodeclone.patch (1.8 KB) - added by strauman on Dec 3, 2006 at 1:31:12 PM.
nodeclone.patch

Download all attachments as: .zip

Change History (2)

comment:1 Changed on Dec 26, 2002 at 2:56:30 PM by Jennifer Averett

Status: assignedclosed

State-Changed-From-To: open->closed
State-Changed-Why: Applied patch.

Changed on Dec 3, 2006 at 1:31:12 PM by strauman

Attachment: nodeclone.patch added

nodeclone.patch

Note: See TracTickets for help on using tickets.