Adding Extended Attribute
     Support to NFS

           James Morris
           Red Hat, Inc.
        jmorris@redhat.com



  LinuxCon 2009 – Portland, OR
Introduction
Extended Attributes
â—Ź   Arbitrary file metadata

â—Ź   Two main types
    â—Ź   System
    â—Ź   User

â—Ź   Non-standard, yet widely implemented
Types of Implementation
â—Ź   Simple name / value pairs
    ●   user.foo = “bar”
    â—Ź   Used by: IRIX, Linux, FreeBSD

â—Ź   Subfiles / forks
    â—Ź   May:
        –   have file semantics (open, seek etc.)
        –   include subdirectories
        –   be highly structured
    â—Ź   Used by Sun, Apple, Microsoft and others
Name/value model
â—Ź   All name/value xattr implementations differ,
    have different APIs, and are generally
    incompatible

â—Ź   Some OSs use flags for 'system', 'user' types

â—Ź   Linux uses text namespaces
    â—Ź   user, system, security, trusted, os2
Linux Implementation
â—Ź   Simple and effective userland API
    â—Ź   setxattr, getxattr, listxattr, removexattr

â—Ź   Probably the most flexible such implementation

â—Ź   System-level xattr use is common
    â—Ź   ACLs, SELinux, SMACK, ecryptfs


â—Ź   User-level xattrs: beagle, ...
NFS Support
â—Ź   Extended attributes are not supported in the
    NFS standards

â—Ź   NFSv3 is closed wrt IETF activity

â—Ź   NFSv4 includes Named Attributes, which are
    based on the Solaris subfile model and
    incompatible with name/value schemes

â—Ź   Several non-standard implementations shipped
Proposal for Linux NFSv3
â—Ź   Implement simple name/value xattr side-
    protocol based on the GPL'd IRIX code

â—Ź   ACL support was added to Linux NFSv3, and
    this is similar in scope and nature

â—Ź   Rationale: all major filesystems have xattrs and
    we should be able to use them over the
    network!
Proposal for Linux NFSv3 (...)
â—Ź   Side-protocol does not break existing protocol

â—Ź   Possibility of interop and establishing a de-facto
    standard for BSD, legacy IRIX clients etc.

â—Ź   NFS availability may encourage more xattr
    adoption (chicken & egg problem)
Linux NFSv3 Status
â—Ź   Prototype code working!

â—Ź   In upstream Linux community RFC process

â—Ź   Initial code
    â—Ź   Limited to user namespace
    â—Ź   Not wire-compatible with IRIX due to differences in
        OS level implementation
    â—Ź   Interoperability certainly possible; need to consider
        usefulness vs. code complexity
NFSv4
â—Ź   NFSv4 needs xattr extension to properly
    support Linux/BSD etc.
    â—Ź   Thankfully, NFSv4 was designed for extensibility!


â—Ź   NFSv3 work should be a useful model for this

â—Ź   IETF process could be lengthy
Discussion
Resources
â—Ź   http://namei.org/nfsxattr
    â—Ź   Code, documents

â—Ź   http://www.linux-nfs.org/
    â—Ź   Useful stepping off point
    â—Ź   Linux NFS mailing list information

Adding Extended Attribute Support to NFS

  • 1.
    Adding Extended Attribute Support to NFS James Morris Red Hat, Inc. jmorris@redhat.com LinuxCon 2009 – Portland, OR
  • 2.
  • 3.
    Extended Attributes â—Ź Arbitrary file metadata â—Ź Two main types â—Ź System â—Ź User â—Ź Non-standard, yet widely implemented
  • 4.
    Types of Implementation ● Simple name / value pairs ● user.foo = “bar” ● Used by: IRIX, Linux, FreeBSD ● Subfiles / forks ● May: – have file semantics (open, seek etc.) – include subdirectories – be highly structured ● Used by Sun, Apple, Microsoft and others
  • 5.
    Name/value model â—Ź All name/value xattr implementations differ, have different APIs, and are generally incompatible â—Ź Some OSs use flags for 'system', 'user' types â—Ź Linux uses text namespaces â—Ź user, system, security, trusted, os2
  • 6.
    Linux Implementation â—Ź Simple and effective userland API â—Ź setxattr, getxattr, listxattr, removexattr â—Ź Probably the most flexible such implementation â—Ź System-level xattr use is common â—Ź ACLs, SELinux, SMACK, ecryptfs â—Ź User-level xattrs: beagle, ...
  • 7.
    NFS Support â—Ź Extended attributes are not supported in the NFS standards â—Ź NFSv3 is closed wrt IETF activity â—Ź NFSv4 includes Named Attributes, which are based on the Solaris subfile model and incompatible with name/value schemes â—Ź Several non-standard implementations shipped
  • 8.
    Proposal for LinuxNFSv3 â—Ź Implement simple name/value xattr side- protocol based on the GPL'd IRIX code â—Ź ACL support was added to Linux NFSv3, and this is similar in scope and nature â—Ź Rationale: all major filesystems have xattrs and we should be able to use them over the network!
  • 9.
    Proposal for LinuxNFSv3 (...) â—Ź Side-protocol does not break existing protocol â—Ź Possibility of interop and establishing a de-facto standard for BSD, legacy IRIX clients etc. â—Ź NFS availability may encourage more xattr adoption (chicken & egg problem)
  • 10.
    Linux NFSv3 Status â—Ź Prototype code working! â—Ź In upstream Linux community RFC process â—Ź Initial code â—Ź Limited to user namespace â—Ź Not wire-compatible with IRIX due to differences in OS level implementation â—Ź Interoperability certainly possible; need to consider usefulness vs. code complexity
  • 11.
    NFSv4 â—Ź NFSv4 needs xattr extension to properly support Linux/BSD etc. â—Ź Thankfully, NFSv4 was designed for extensibility! â—Ź NFSv3 work should be a useful model for this â—Ź IETF process could be lengthy
  • 12.
  • 13.
    Resources â—Ź http://namei.org/nfsxattr â—Ź Code, documents â—Ź http://www.linux-nfs.org/ â—Ź Useful stepping off point â—Ź Linux NFS mailing list information