11 Jan, 2012

1 commit

  • * 'nfs-for-3.3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
    NFSv4: Change the default setting of the nfs4_disable_idmapping parameter
    NFSv4: Save the owner/group name string when doing open
    NFS: Remove pNFS bloat from the generic write path
    pnfs-obj: Must return layout on IO error
    pnfs-obj: pNFS errors are communicated on iodata->pnfs_error
    NFS: Cache state owners after files are closed
    NFS: Clean up nfs4_find_state_owners_locked()
    NFSv4: include bitmap in nfsv4 get acl data
    nfs: fix a minor do_div portability issue
    NFSv4.1: cleanup comment and debug printk
    NFSv4.1: change nfs4_free_slot parameters for dynamic slots
    NFSv4.1: cleanup init and reset of session slot tables
    NFSv4.1: fix backchannel slotid off-by-one bug
    nfs: fix regression in handling of context= option in NFSv4
    NFS - fix recent breakage to NFS error handling.
    NFS: Retry mounting NFSROOT
    SUNRPC: Clean up the RPCSEC_GSS service ticket requests

    Linus Torvalds
     

07 Jan, 2012

4 commits


05 Jan, 2012

1 commit

  • Setting the security context of a NFSv4 mount via the context= mount
    option is currently broken. The NFSv4 codepath allocates a parsed
    options struct, and then parses the mount options to fill it. It
    eventually calls nfs4_remote_mount which calls security_init_mnt_opts.
    That clobbers the lsm_opts struct that was populated earlier. This bug
    also looks like it causes a small memory leak on each v4 mount where
    context= is used.

    Fix this by moving the initialization of the lsm_opts into
    nfs_alloc_parsed_mount_data. Also, add a destructor for
    nfs_parsed_mount_data to make it easier to free all of the allocations
    hanging off of it, and to ensure that the security_free_mnt_opts is
    called whenever security_init_mnt_opts is.

    I believe this regression was introduced quite some time ago, probably
    by commit c02d7adf.

    Cc: stable@vger.kernel.org
    Signed-off-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Jeff Layton
     

04 Jan, 2012

2 commits


17 Nov, 2011

2 commits

  • takes vfsmount and relative path, does lookup within that vfsmount
    (possibly triggering automounts) and returns the result as root
    of subtree suitable for return by ->mount() (i.e. a reference to
    dentry and an active reference to its superblock grabbed, superblock
    locked exclusive).

    btrfs and nfs switched to it instead of open-coding the sucker.

    Signed-off-by: Al Viro

    Al Viro
     
  • Life is much saner if create_mnt_ns(mnt) drops mnt in case of error...
    Switch it to such calling conventions, switch callers, fix double mntput() in
    fs/nfs/super.c one.

    Signed-off-by: Al Viro

    Al Viro
     

19 Oct, 2011

1 commit

  • commit ae50c0b5 "pnfs: client stats" added additional information to
    the output of /proc/self/mountstats. The new functions introduced are
    only used in this file and should be marked static.

    If CONFIG_NFS_V4_1 is not defined, empty stub functions are used. If
    CONFIG_NFS_V4 is not defined these stub functions are not used at all.
    Adding static for the functions results in compile warnings:

    fs/nfs/super.c:743: warning: 'show_sessions' defined but not used
    fs/nfs/super.c:756: warning: 'show_pnfs' defined but not used

    Fix this by adding a #ifdef CONFIG_NFS_V4 guard around the two
    show_ functions.

    Signed-off-by: H Hartley Sweeten
    Cc: Trond Myklebust
    Signed-off-by: Trond Myklebust

    H Hartley Sweeten
     

27 Sep, 2011

1 commit

  • The concensus seems to be that system calls such as stat() etc should
    not trigger an automount. Neither should the l* versions.

    This patch therefore adds a LOOKUP_AUTOMOUNT flag to tag those lookups
    that _should_ trigger an automount on the last path element.

    Signed-off-by: Trond Myklebust
    [ Edited to leave out the cases that are already covered by LOOKUP_OPEN,
    LOOKUP_DIRECTORY and LOOKUP_CREATE - all of which also fundamentally
    force automounting for their own reasons - Linus ]
    Signed-off-by: Linus Torvalds

    Trond Myklebust
     

14 Sep, 2011

1 commit

  • Do not allow multiple mounts on same mountpoint when using -o noac

    When you normally attempt to mount a share twice on the same mountpoint,
    a check in do_add_mount causes it to return an error

    # mount localhost:/nfsv3 /mnt
    # mount localhost:/nfsv3 /mnt
    mount.nfs: /mnt is already mounted or busy

    However when using the option 'noac', the user is able to mount the same
    share on the same mountpoint multiple times. This happens because a
    share mounted with the noac option is automatically assigned the 'sync'
    flag MS_SYNCHRONOUS in nfs_initialise_sb(). This flag is set after the
    check for already existing superblocks is done in sget(). The check for
    the mount flags in nfs_compare_mount_options() does not take into
    account the 'sync' flag applied later on in the code path. This means
    that when using 'noac', a new superblock structure is assigned for every
    new mount of the same share and multiple shares on the same mountpoint
    are allowed.

    ie.
    # mount -onoac localhost:/nfsv3 /mnt
    can be run multiple times.

    The patch checks for noac and assigns the sync flag before sget() is
    called to obtain an already existing superblock structure.

    Signed-off-by: Sachin Prabhu
    Reviewed-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Sachin Prabhu
     

20 Jul, 2011

1 commit


30 May, 2011

1 commit

  • A pNFS client auto-negotiates a lot of features (minorversion level,
    pNFS layout type, etc.). This is convenient, but makes certain kinds of
    failures hard for a user to detect.

    For example, if the client falls back on 4.0, or falls back to MDS IO
    because the user didn't connect to the right iscsi disks before
    mounting, the only symptoms may be reduced performance, which may not be
    noticed till long after the actual failure, and may be difficult for a
    user to diagnose.

    However, such "failures" may also be perfectly normal in some cases, so
    we don't want to spam the system logs with them.

    One approach would be to put some more information into
    /proc/self/mountstats.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Benny Halevy
    [pnfs: add commit client stats]
    [fixup data types for "ret" variables in pnfs_try_to* inline funcs.]
    Signed-off-by: Benny Halevy
    [fix definition of show_pnfs for !CONFIG_PNFS]
    Signed-off-by: Benny Halevy
    [nfs41: Fix show_sessions in the not CONFIG_NFS_V4_1 case]
    There is a build error when CONFIG_NFS_V4 is set but
    CONFIG_NFS_V4_1 is *not* set. show_sessions() prototype
    was unbalanced between the two cases.
    Signed-off-by: Boaz Harrosh
    [pnfs: super.c remove CONFIG_PNFS]
    Signed-off-by: Andy Adamson
    Signed-off-by: Benny Halevy

    J. Bruce Fields
     

28 Apr, 2011

1 commit

  • On a remount, the VFS layer will clear the MS_SYNCHRONOUS bit on the
    assumption that the flags on the mount syscall will have it set if the
    remounted fs is supposed to keep it.

    In the case of "noac" though, MS_SYNCHRONOUS is implied. A remount of
    such a mount will lose the MS_SYNCHRONOUS flag since "sync" isn't part
    of the mount options.

    Reported-by: Max Matveev
    Signed-off-by: Jeff Layton
    Cc: stable@kernel.org
    Signed-off-by: Trond Myklebust

    Jeff Layton
     

14 Apr, 2011

1 commit


13 Apr, 2011

1 commit

  • In fs/nfs/super.c::nfs_fs_mount() we test for a NULL 'data':

    ...
    if (data == NULL || mntfh == NULL)
    goto out_free_fh;
    ...

    and then further down in the function we test 'data' again:

    ...
    nfs_fscache_get_super_cookie(
    s, data ? data->fscache_uniq : NULL, NULL);
    ...

    this second check is just dead code since there is no way 'data' could
    possibly be NULL here.
    We also rely on a non-NULL 'data' in more than one location between these
    two tests, further proving the point that the second test is bogus.

    This patch removes the dead code.

    Signed-off-by: Jesper Juhl
    Signed-off-by: Trond Myklebust

    Jesper Juhl
     

18 Mar, 2011

1 commit

  • * 'nfs-for-2.6.39' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (54 commits)
    RPC: killing RPC tasks races fixed
    xprt: remove redundant check
    SUNRPC: Convert struct rpc_xprt to use atomic_t counters
    SUNRPC: Ensure we always run the tk_callback before tk_action
    sunrpc: fix printk format warning
    xprt: remove redundant null check
    nfs: BKL is no longer needed, so remove the include
    NFS: Fix a warning in fs/nfs/idmap.c
    Cleanup: Factor out some cut-and-paste code.
    cleanup: save 60 lines/100 bytes by combining two mostly duplicate functions.
    NFS: account direct-io into task io accounting
    gss:krb5 only include enctype numbers in gm_upcall_enctypes
    RPCRDMA: Fix FRMR registration/invalidate handling.
    RPCRDMA: Fix to XDR page base interpretation in marshalling logic.
    NFSv4: Send unmapped uid/gids to the server when using auth_sys
    NFSv4: Propagate the error NFS4ERR_BADOWNER to nfs4_do_setattr
    NFSv4: cleanup idmapper functions to take an nfs_server argument
    NFSv4: Send unmapped uid/gids to the server if the idmapper fails
    NFSv4: If the server sends us a numeric uid/gid then accept it
    NFSv4.1: reject zero layout with zeroed stripe unit
    ...

    Linus Torvalds
     

17 Mar, 2011

5 commits


12 Mar, 2011

2 commits


13 Jan, 2011

1 commit


05 Jan, 2011

2 commits

  • This patch make nfsv4 use the generic xattr handling code
    to get the nfsv4 acl. This will help us to add richacl
    support to nfsv4 in later patches

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Trond Myklebust

    Aneesh Kumar K.V
     
  • We want to skip VFS applying mode for NFS. So set MS_POSIXACL always
    and selectively use umask. Ideally we would want to use umask only
    when we don't have inheritable ACEs set. But NFS currently don't
    allow to send umask to the server. So this is best what we can do
    and this is consistent with NFSv3

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Trond Myklebust

    Aneesh Kumar K.V
     

22 Dec, 2010

1 commit

  • Update: added check for zero value as it was before (note: can't simply check
    mountd_port for positive value because it's typeof unsigned short)

    Default value for mount server port is set to NFS_UNSPEC_PORT (-1) and will not
    be changed during parsing mount options for mound data version 6. This default
    value will be showed for mountport in /proc/mounts always since current default
    check is for zero value. This small mistake leads to big problem, because
    during umount.nfs execution from old user-space utils (at least nfs-utils
    1.0.9) this value will be used as the server port to connect to. This request
    will be rejected (since port is 65535) and thus nfs mount point can't be
    unmounted.

    Note from Chuck Lever (chuck.lever@oracle.com): this is only possible if
    /etc/mtab is a link to /proc/mounts. Not all systems have this configuration.

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: Trond Myklebust

    Stanislav Kinsbursky
     

08 Dec, 2010

1 commit

  • When nfs client(kernel) don't support NFSv4, maybe user build
    kernel without NFSv4, there is a problem.

    Using command "mount SERVER-IP:/nfsv3 /mnt/" to mount NFSv3
    filesystem, mount should should success, but fail and get error:

    "mount.nfs: an incorrect mount option was specified"

    System call mount "nfs"(not "nfs4") with "vers=4",
    if CONFIG_NFS_V4 is not defined, the "vers=4" will be parsed
    as invalid argument and kernel return EINVAL to nfs-utils.

    About that, we really want get EPROTONOSUPPORT rather than
    EINVAL. This path make sure kernel parses argument success,
    and return EPROTONOSUPPORT at nfs_validate_mount_data().

    Signed-off-by: Mi Jinlong
    Signed-off-by: Trond Myklebust

    Mi Jinlong
     

18 Nov, 2010

1 commit


16 Nov, 2010

1 commit

  • Trying to mount NFS (root partition in my case) fails if CONFIG_NFS_V3
    is not selected. nfs_validate_mount_data() returns EPROTONOSUPPORT,
    because of this check:

    #ifndef CONFIG_NFS_V3
    if (args->version == 3)
    goto out_v3_not_compiled;
    #endif /* !CONFIG_NFS_V3 */

    and args->version was always initialized to 3.

    It was working in 2.6.36

    Signed-off-by: Paulius Zaleckas
    Signed-off-by: Trond Myklebust

    Paulius Zaleckas
     

29 Oct, 2010

1 commit


26 Oct, 2010

1 commit

  • * 'nfs-for-2.6.37' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (67 commits)
    SUNRPC: Cleanup duplicate assignment in rpcauth_refreshcred
    nfs: fix unchecked value
    Ask for time_delta during fsinfo probe
    Revalidate caches on lock
    SUNRPC: After calling xprt_release(), we must restart from call_reserve
    NFSv4: Fix up the 'dircount' hint in encode_readdir
    NFSv4: Clean up nfs4_decode_dirent
    NFSv4: nfs4_decode_dirent must clear entry->fattr->valid
    NFSv4: Fix a regression in decode_getfattr
    NFSv4: Fix up decode_attr_filehandle() to handle the case of empty fh pointer
    NFS: Ensure we check all allocation return values in new readdir code
    NFS: Readdir plus in v4
    NFS: introduce generic decode_getattr function
    NFS: check xdr_decode for errors
    NFS: nfs_readdir_filler catch all errors
    NFS: readdir with vmapped pages
    NFS: remove page size checking code
    NFS: decode_dirent should use an xdr_stream
    SUNRPC: Add a helper function xdr_inline_peek
    NFS: remove readdir plus limit
    ...

    Linus Torvalds
     

24 Sep, 2010

1 commit


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
     

13 Sep, 2010

1 commit

  • Hi,

    An NFS client executes a statfs("file", &buff) call.
    "file" exists / existed, the client has read / written it,
    but it has already closed it.

    user_path(pathname, &path) looks up "file" successfully in the
    directory-cache and restarts the aging timer of the directory-entry.
    Even if "file" has already been removed from the server, because the
    lookupcache=positive option I use, keeps the entries valid for a while.

    nfs_statfs() returns ESTALE if "file" has already been removed from the
    server.

    If the user application repeats the statfs("file", &buff) call, we
    are stuck: "file" remains young forever in the directory-cache.

    Signed-off-by: Zoltan Menyhart
    Signed-off-by: Trond Myklebust
    Cc: stable@kernel.org

    Menyhart Zoltan
     

19 Aug, 2010

1 commit

  • * 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
    NFS: Fix an Oops in the NFSv4 atomic open code
    NFS: Fix the selection of security flavours in Kconfig
    NFS: fix the return value of nfs_file_fsync()
    rpcrdma: Fix SQ size calculation when memreg is FRMR
    xprtrdma: Do not truncate iova_start values in frmr registrations.
    nfs: Remove redundant NULL check upon kfree()
    nfs: Add "lookupcache" to displayed mount options
    NFS: allow close-to-open cache semantics to apply to root of NFS filesystem
    SUNRPC: fix NFS client over TCP hangs due to packet loss (Bug 16494)

    Linus Torvalds
     

11 Aug, 2010

1 commit