140 likes | 304 Views
WinAFS Symlink s. Reparse Points and Volumes. AFS name space managed as mini-file systems (aka Volumes) AFS Mount Points are the equivalent of NTFS Junctions and DFS Referrals which are stored and exposed as via Reparse Points. What are Reparse Points?.
E N D
Reparse Points and Volumes • AFS name space managed as mini-file systems (aka Volumes) • AFS Mount Points are the equivalent of NTFS Junctions and DFS Referrals which are stored and exposed as via Reparse Points
What are Reparse Points? A Reparse Point can be thought of as a special form of Extended Attribute which is interpreted by File System and Filter Drivers. Reparse Point Data is typed. A registered tag identifier determines the data structure of the RP data. RPs can be used to represent volume joins, symlinks, hierarchical storage management objects, dedupobjects, etc.
AFS Mount Points as RPs • Exposing AFS Mount Points as RPs identifies volume boundaries to applications. Upon crossing a RP the following may change: • Volume name and serial number • Partition size • Free disk space or Quotas • Volume attributes (ReadOnly) • Latency • Apps alter UI to match
AFS Symlinksvs MicrosoftSymlinks • AFS Symlinks are POSIX • Target type is not encoded in the target path • Relative or absolute paths • Forward slash separators • MSFT Symlinks are not POSIX • Target type is encoded in the symlink object • Either a directory or a file with RP Data attached • Relative or absolute paths • Backslash separators
AFS Symlinks as Reparse Points • Goal to permit symlinks both within AFS name space and to arbitrary Windows paths • C:\ (local disk) • \\msad\dfs-share\path (arbitrary UNC paths to directories) • AFS Symlink objects can be copied to and from non-AFS storage (robocopy /SL option) • Symlinks exposed using Microsoft’s IO_REPARSE_TAG_SYMLINK • FSCTL_GET_REPARSE_DATA / FSCTL_SET_REPARSE_DATA
Win32 File System RP Behavior • Any directory entry might be a Reparse Point • File Attribute “RP” used to indicate if it is • CreateFile (OpenReparsePoint option) used to open the RP (if any). Failure to specify option opens the target object • FindFile*, GetFileAttributes*, GetFileSecurity* APIs always set the OpenReparsePoint option. • Must use CreateFile and GetFileInformationByHandleW to obtain target attributes.
Why Open RPs by default? • The existence of an RPs might indicate that accessing the target is an expensive operation • Directory listings should be fast • Failure to return RP’s file information would result in applications being unaware that an object is a RP. • Imagine the complaints if a directory of objects backed by tape required the tapes be loaded each time a directory enumeration is performed.
Reparse Point File Information • Timestamps (Creation, Last Modified, Last Accessed) • File Size (size of Reparse Point Data) • Reparse Point Tag identifier • Attributes: RP, D, N, A, S, H, etc • Apps that ignore the RP attribute and assume the file information applies to the target object can mistake the Reparse Point File Size and Timestamps. • Truncated file data • Failure to notice data changes
Examples of broken apps @ MS • .NET frameworks (all versions) • JAVA Classes (1.6 and earlier) • Cygwin (all versions discard RP attribute from non-MSFT RP Tags) • Other???
Workaround? • Symlinks to files are the issue. • Proposal: • Patch AFS redirector to report symlinks to files as if they were hard links to the target • Downside: • Apps do not notice volume changes • Link counts are wrong • Attempts to delete symlink entry result in deletion of the target object. • Symlinks cannot be copied
Just an AFS Problem? • NO! • Same behaviors will be seen on all file systems that include Reparse Points • Microsoft NTFS • Microsoft ReFS (Server 2012 and Windows Blue) • Many third party products
Recommendation from YFSI • All new applications to be developed RP aware • Existing applications to be fixed when possible • Leave AFS redirector defaults alone • Add FSCTL operation to permit Symlinks to Files to be reported as Hard Links on a per-AuthGroup basis for apps that cannot be fixed • WinAurora can be modified to issue the FSCTL on process instantiation based upon module environment variables • Global default change will result in apps never becomingReFS compatible
255 W 94TH STNew York NY 10025 USA+1 212 769-9018sales@your-file-system.com http://www.your-file-system.com