]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Merge tag 'nfs-for-4.13-5' of git://git.linux-nfs.org/projects/anna/linux-nfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 11 Aug 2017 20:54:09 +0000 (13:54 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 11 Aug 2017 20:54:09 +0000 (13:54 -0700)
Pull NFS client fixes from Anna Schumaker:
 "A few more NFS client bugfixes from me for rc5.

  Dros has a stable fix for flexfiles to prevent leaking the
  nfs4_ff_ds_version arrays when freeing a layout, Trond fixed a
  potential recovery loop situation with the TEST_STATEID operation, and
  Christoph fixed up the pNFS blocklayout Kconfig options to prevent
  unsafe use with kernels that don't have large block device support.
  Summary:

  Stable fix:
   - fix leaking nfs4_ff_ds_version array

  Other fixes:
   - improve TEST_STATEID OLD_STATEID handling to prevent recovery loop

   - require 64-bit sector_t for pNFS blocklayout to prevent 32-bit
     compile errors"

* tag 'nfs-for-4.13-5' of git://git.linux-nfs.org/projects/anna/linux-nfs:
  pnfs/blocklayout: require 64-bit sector_t
  NFSv4: Ignore NFS4ERR_OLD_STATEID in nfs41_check_open_stateid()
  nfs/flexfiles: fix leak of nfs4_ff_ds_version arrays

1  2 
fs/nfs/nfs4proc.c

diff --combined fs/nfs/nfs4proc.c
index ffd2e712595d8ac875dc2780b52731543c687ca8,cbf9cdd48a3b6182a7b6e653552cae3e90b49ffd..d901326423401c3e7d442f62bfa80d03d281ed02
@@@ -2553,9 -2553,8 +2553,8 @@@ static int nfs41_check_open_stateid(str
                clear_bit(NFS_O_RDWR_STATE, &state->flags);
                clear_bit(NFS_OPEN_STATE, &state->flags);
                stateid->type = NFS4_INVALID_STATEID_TYPE;
-       }
-       if (status != NFS_OK)
                return status;
+       }
        if (nfs_open_stateid_recover_openmode(state))
                return -NFS4ERR_OPENMODE;
        return NFS_OK;
@@@ -2596,8 -2595,7 +2595,8 @@@ static inline void nfs4_exclusive_attrs
  
        /* Except MODE, it seems harmless of setting twice. */
        if (opendata->o_arg.createmode != NFS4_CREATE_EXCLUSIVE &&
 -              attrset[1] & FATTR4_WORD1_MODE)
 +              (attrset[1] & FATTR4_WORD1_MODE ||
 +               attrset[2] & FATTR4_WORD2_MODE_UMASK))
                sattr->ia_valid &= ~ATTR_MODE;
  
        if (attrset[2] & FATTR4_WORD2_SECURITY_LABEL)
@@@ -6428,7 -6426,7 +6427,7 @@@ struct nfs4_lock_waiter 
  };
  
  static int
 -nfs4_wake_lock_waiter(wait_queue_t *wait, unsigned int mode, int flags, void *key)
 +nfs4_wake_lock_waiter(wait_queue_entry_t *wait, unsigned int mode, int flags, void *key)
  {
        int ret;
        struct cb_notify_lock_args *cbnl = key;
@@@ -6471,7 -6469,7 +6470,7 @@@ nfs4_retry_setlk(struct nfs4_state *sta
                                           .inode = state->inode,
                                           .owner = &owner,
                                           .notified = false };
 -      wait_queue_t wait;
 +      wait_queue_entry_t wait;
  
        /* Don't bother with waitqueue if we don't expect a callback */
        if (!test_bit(NFS_STATE_MAY_NOTIFY_LOCK, &state->flags))
@@@ -8458,7 -8456,6 +8457,7 @@@ static void nfs4_layoutget_release(voi
        size_t max_pages = max_response_pages(server);
  
        dprintk("--> %s\n", __func__);
 +      nfs4_sequence_free_slot(&lgp->res.seq_res);
        nfs4_free_pages(lgp->args.layout.pages, max_pages);
        pnfs_put_layout_hdr(NFS_I(inode)->layout);
        put_nfs_open_context(lgp->args.ctx);
@@@ -8533,6 -8530,7 +8532,6 @@@ nfs4_proc_layoutget(struct nfs4_layoutg
        /* if layoutp->len is 0, nfs4_layoutget_prepare called rpc_exit */
        if (status == 0 && lgp->res.layoutp->len)
                lseg = pnfs_layout_process(lgp);
 -      nfs4_sequence_free_slot(&lgp->res.seq_res);
        rpc_put_task(task);
        dprintk("<-- %s status=%d\n", __func__, status);
        if (status)