23 Sep, 2010

1 commit

  • NFS clients since 2.6.12 support flock locks by emulating fcntl byte-range
    locks. Due to this, some windows applications which seem to use both flock
    (share mode lock mapped as flock by Samba) and fcntl locks sequentially on
    the same file, can't lock as they falsely assume the file is already locked.
    The problem was reported on a setup with windows clients accessing excel files
    on a Samba exported share which is originally a NFS mount from a NetApp filer.

    Older NFS clients (< 2.6.12) did not see this problem as flock locks were
    considered local. To support legacy flock behavior, this patch adds a mount
    option "-olocal_lock=" which can take the following values:

    'none' - Neither flock locks nor POSIX locks are local
    'flock' - flock locks are local
    'posix' - fcntl/POSIX locks are local
    'all' - Both flock locks and POSIX locks are local

    Testing:

    - This patch was tested by using -olocal_lock option with different values
    and the NLM calls were noted from the network packet captured.

    'none' - NLM calls were seen during both flock() and fcntl(), flock lock
    was granted, fcntl was denied
    'flock' - no NLM calls for flock(), NLM call was seen for fcntl(),
    granted
    'posix' - NLM call was seen for flock() - granted, no NLM call for fcntl()
    'all' - no NLM calls were seen during both flock() and fcntl()

    - No bugs were seen during NFSv4 locking/unlocking in general and NFSv4
    reboot recovery.

    Cc: Neil Brown
    Signed-off-by: Suresh Jayaraman
    Signed-off-by: Trond Myklebust

    Suresh Jayaraman
     

07 Aug, 2010

1 commit


24 Dec, 2008

1 commit

  • The standard default security setting for NFS is AUTH_SYS. An NFS
    client connects to NFS servers via a privileged source port and a
    fixed standard destination port (2049). The client sends raw uid and
    gid numbers to identify users making NFS requests, and the server
    assumes an appropriate authority on the client has vetted these
    values because the source port is privileged.

    On Linux, by default in-kernel RPC services use a privileged port in
    the range between 650 and 1023 to avoid using source ports of well-
    known IP services. Using such a small range limits the number of NFS
    mount points and the number of unique NFS servers to which a client
    can connect concurrently.

    An NFS client can use unprivileged source ports to expand the range of
    source port numbers, allowing more concurrent server connections and
    more NFS mount points. Servers must explicitly allow NFS connections
    from unprivileged ports for this to work.

    In the past, bumping the value of the sunrpc.max_resvport sysctl on
    the client would permit the NFS client to use unprivileged ports.
    Bumping this setting also changes the maximum port number used by
    other in-kernel RPC services, some of which still required a port
    number less than 1023.

    This is exacerbated by the way source port numbers are chosen by the
    Linux RPC client, which starts at the top of the range and works
    downwards. It means that bumping the maximum means all RPC services
    requesting a source port will likely get an unprivileged port instead
    of a privileged one.

    Changing this setting effects all NFS mount points on a client. A
    sysadmin could not selectively choose which mount points would use
    non-privileged ports and which could not.

    Lastly, this mechanism of expanding the limit on the number of NFS
    mount points was entirely undocumented.

    To address the need for the NFS client to use a large range of source
    ports without interfering with the activity of other in-kernel RPC
    services, we introduce a new NFS mount option. This option explicitly
    tells only the NFS client to use a non-privileged source port when
    communicating with the NFS server for one specific mount point.

    This new mount option is called "resvport," like the similar NFS mount
    option on FreeBSD and Mac OS X. A sister patch for nfs-utils will be
    submitted that documents this new option in nfs(5).

    The default setting for this new mount option requires the NFS client
    to use a privileged port, as before. Explicitly specifying the
    "noresvport" mount option allows the NFS client to use an unprivileged
    source port for this mount point when connecting to the NFS server
    port.

    This mount option is supported only for text-based NFS mounts.

    [ Sidebar: it is widely known that security mechanisms based on the
    use of privileged source ports are ineffective. However, the NFS
    client can combine the use of unprivileged ports with the use of
    secure authentication mechanisms, such as Kerberos. This allows a
    large number of connections and mount points while ensuring a useful
    level of security.

    Eventually we may change the default setting for this option
    depending on the security flavor used for the mount. For example,
    if the mount is using only AUTH_SYS, then the default setting will
    be "resvport;" if the mount is using a strong security flavor such
    as krb5, the default setting will be "noresvport." ]

    Signed-off-by: Chuck Lever
    [Trond.Myklebust@netapp.com: Fixed a bug whereby nfs4_init_client()
    was being called with incorrect arguments.]
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

08 Oct, 2008

1 commit

  • Add the flag NFS_MOUNT_LOOKUP_CACHE_NONEG to turn off the caching of
    negative dentries. In reality what we do is to force
    nfs_lookup_revalidate() to always discard negative dentries.

    Add the flag NFS_MOUNT_LOOKUP_CACHE_NONE for enforcing stricter
    revalidation of dentries. It forces the revalidate code to always do a
    lookup instead of just checking the cached mtime of the parent directory.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

07 Dec, 2007

1 commit


11 Jul, 2007

2 commits

  • Prior to David Howell's mount changes in 2.6.18, users who mounted
    different directories which happened to be from the same filesystem on the
    server would get different super blocks, and hence could choose different
    mount options. As long as there were no hard linked files that crossed from
    one subtree to another, this was quite safe.
    Post the changes, if the two directories are on the same filesystem (have
    the same 'fsid'), they will share the same super block, and hence the same
    mount options.

    Add a flag to allow users to elect not to share the NFS super block with
    another mount point, even if the fsids are the same. This will allow
    users to set different mount options for the two different super blocks, as
    was previously possible. It is still up to the user to ensure that there
    are no cache coherency issues when doing this, however the default
    behaviour will be to share super blocks whenever two paths result in
    the same fsid.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

01 May, 2007

1 commit

  • READDIRPLUS can be a performance hindrance when the client is working with
    large directories. In addition, some servers still have bugs in their
    implementations (e.g. Tru64 returns wrong values for the fsid).

    Add a mount flag to enable users to turn it off at mount time following the
    implementation in Apple's NFS client.

    Signed-off-by: Steve Dickson
    Signed-off-by: Trond Myklebust

    Steve Dickson
     

23 Jun, 2005

1 commit

  • This adds acl support fo nfs clients via the NFSACL protocol extension, by
    implementing the getxattr, listxattr, setxattr, and removexattr iops for the
    system.posix_acl_access and system.posix_acl_default attributes. This patch
    implements a dumb version that uses no caching (and thus adds some overhead).
    (Another patch in this patchset adds caching as well.)

    Signed-off-by: Andreas Gruenbacher
    Acked-by: Olaf Kirch
    Signed-off-by: Andrew Morton
    Signed-off-by: Trond Myklebust

    Andreas Gruenbacher
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds