28 Apr, 2011

3 commits

  • 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
     
  • When compiling, I was getting this warning:
    fs/nfs/nfs4xdr.c: In function ‘decode_secinfo’:
    fs/nfs/nfs4xdr.c:4839:6: warning: variable ‘status’ set but not used
    [-Wunused-but-set-variable]

    We were unconditionally returning 0 as long as there wasn't an error
    coming out of xdr_inline_decode(). We probably want to check the error
    status coming out of decode_op_hdr() and decode_secinfo_gss(), rather
    than assuming that everything is OK all the time.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     
  • When readdir() returns a directory entry for the root of a mounted
    filesystem, Linux follows the old convention of returning the inode
    number of the covered directory (despite newer versions of POSIX declaring
    that this is a bug).
    To ensure this continues to work, the NFSv4 readdir implementation requests
    the 'mounted-on-fileid' from the server.

    However, readdirplus also needs to instantiate an inode for this entry, and
    for that, we also need to request the real fileid as per this patch.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

25 Apr, 2011

2 commits


19 Apr, 2011

2 commits


16 Apr, 2011

1 commit


14 Apr, 2011

6 commits

  • While decoding a secinfo reply, I store the list of supported sec
    flavors on a page accessible through res->flavors. Before reading
    each new flavor, I do some math to determine if there is enough
    space left on this page, and I break out of my read look if there
    isn't. In order to perform this check correctly, I need to use the
    address of res->flavors, rather than the address of res.

    When this loop was broken early I lied to the caller and told them
    that the entire list had been decoded. This could lead to problems
    if the caller tries to use any the garbage data claiming to be a
    valid sec flavor. I fixed this by using res->flavors->num_flavors
    as a counter, incrementing it every time a sec flavor is
    successfully decoded.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     
  • We were always attempting sec flavor negotiation, even if the user
    told us a specific sec flavor to use. If that sec flavor fails,
    we should return an error rather than continuing with sec flavor
    negotiation.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     
  • nfs4_lookup_root() is already configured to use either RPC_AUTH_UNIX
    or a user specified flavor (through -o sec=). We should
    use this flavor first, and only attempt negotiation if it fails
    with -EPERM.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     
  • NFS_MAX_SECFLAVORS should already take into account RPC_AUTH_UNIX
    and RPC_AUTH_NULL, so we don't need to set aside extra slots
    for them.

    Signed-off-by: Bryan Schumaker
    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     
  • There can be an infinite loop if gss_create_upcall() is called without
    the userspace program running. To prevent this, we return -EACCES if
    we notice that pipe_version hasn't changed (indicating that the pipe
    has not been opened).

    Signed-off-by: Bryan Schumaker

    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     
  • mark_inode_dirty_sync() grabs the same inode lock!

    race conditions between holding the lock in pnfs_set_layoutcommit() and in
    mark_inode_dirty_sync() can result in a second call to pnfs_layoutcommit_inode(), but
    this will be a noop as NFS_INO_LAYOUTCOMMIT won't be set in the second call

    Signed-off-by: Weston Andros Adamson
    Signed-off-by: Trond Myklebust

    Weston Andros Adamson
     

13 Apr, 2011

5 commits


09 Apr, 2011

1 commit


08 Apr, 2011

1 commit


07 Apr, 2011

1 commit

  • rpc_authflavor_t is cast from an unsigned int, but the
    initial code tried to use it as a signed int. I fix
    this by passing an rpc_authflavor_t pointer around, and
    returning signed integers from functions.

    Signed-off-by: Bryan Schumaker
    Reported-by: Dan Carpenter
    Signed-off-by: Trond Myklebust

    Bryan Schumaker
     

31 Mar, 2011

1 commit


29 Mar, 2011

1 commit

  • Fix the incorrect use of igrab() inside the i_lock in NFS and Ceph‥

    If we are already holding the i_lock, we have a reference to the
    inode so we can safely use ihold() to gain an extra reference. This
    avoids hangs due to lock recursion on the i_lock now that the
    inode_lock is gone and igrab() uses the i_lock itself.

    Signed-off-by: Dave Chinner
    Cc: Al Viro
    Cc: linux-fsdevel@vger.kernel.org
    Cc: Ryan Mallon
    Signed-off-by: Linus Torvalds

    Dave Chinner
     

27 Mar, 2011

2 commits


25 Mar, 2011

9 commits


24 Mar, 2011

5 commits

  • Now that all the infrastructure is in place, we will do the
    right thing if we remove this special casing.

    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Fred Isaman
     
  • The filelayout driver sends LAYOUTCOMMIT only when COMMIT goes to
    the data server (as opposed to the MDS) and the data server WRITE
    is not NFS_FILE_SYNC.

    Only whole file layout support means that there is only one IOMODE_RW layout
    segment.

    Signed-off-by: Andy Adamson
    Signed-off-by: Alexandros Batsakis
    Signed-off-by: Boaz Harrosh
    Signed-off-by: Dean Hildebrand
    Signed-off-by: Fred Isaman
    Signed-off-by: Mingyang Guo
    Signed-off-by: Tao Guo
    Signed-off-by: Zhang Jingwang
    Tested-by: Boaz Harrosh
    Signed-off-by: Benny Halevy
    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Andy Adamson
     
  • Implement all the hooks created in the previous patches.
    This requires exporting quite a few functions and adding a few
    structure fields.

    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Fred Isaman
     
  • Any COMMIT compound directed to a data server needs to have the
    GETATTR calls suppressed. We here, make sure the field we are testing
    (data->lseg) is set and refcounted correctly.

    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Fred Isaman
     
  • We create three major hooks for the pnfs code.

    pnfs_mark_request_commit() is called during writeback_done from
    nfs_mark_request_commit, which gives the driver an opportunity to
    claim it wants control over commiting a particular req.

    pnfs_choose_commit_list() is called from nfs_scan_list
    to choose which list a given req should be added to, based on
    where we intend to send it for COMMIT. It is up to the driver
    to have preallocated list headers for each destination it may need.

    pnfs_commit_list() is how the driver actually takes control, it is
    used instead of nfs_commit_list().

    In order to pass information between the above functions, we create
    a union in nfs_page to hold a lseg (which is possible because the req is
    not on any list while in transition), and add some flags to indicate
    if we need to use the pnfs code.

    Signed-off-by: Fred Isaman
    Signed-off-by: Trond Myklebust

    Fred Isaman