AFS name space managed as mini-file systems (aka Volumes) AFS Mount Points are the equivalent of...

Preview:

Citation preview

WinAFS Symlinks

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

root.afs

winaurora platform other

ms.dist ms.dev

Reparse Points and Volumes

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, dedup objects, etc.

What are Reparse Points?

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 Mount Points as RPs

• 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 vs Microsoft Symlinks

• 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

AFS Symlinks as Reparse Points

• 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.

Win32 File System RP Behavior

• 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.

Why Open RPs by default?

• 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

Reparse Point File Information

• .NET frameworks (all versions)• JAVA Classes (1.6 and earlier)• Cygwin (all versions discard RP attribute from non-

MSFT RP Tags)• Other???

Examples of broken apps @ MS

• 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

Workaround?

• 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

Just an AFS Problem?

• 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

Recommendation from YFSI

255 W 94TH STNew York NY 10025 USA

+1 212 769-9018sales@your-file-system.com

http://www.your-file-system.com

Recommended