]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/nfs/nfs4proc.c
UBUNTU: [Config] updateconfigs after removing powerpc builds
[mirror_ubuntu-zesty-kernel.git] / fs / nfs / nfs4proc.c
index ecc151697fd4bd81288941848a4b6a76e7563a24..37bcd887f7428d21dd17d78bb331e1820fa0fad6 100644 (file)
@@ -815,10 +815,6 @@ static int nfs41_sequence_process(struct rpc_task *task,
        case -NFS4ERR_SEQ_FALSE_RETRY:
                ++slot->seq_nr;
                goto retry_nowait;
-       case -NFS4ERR_DEADSESSION:
-       case -NFS4ERR_BADSESSION:
-               nfs4_schedule_session_recovery(session, res->sr_status);
-               goto retry_nowait;
        default:
                /* Just update the slot sequence no. */
                slot->seq_done = 1;
@@ -2700,7 +2696,8 @@ static inline void nfs4_exclusive_attrset(struct nfs4_opendata *opendata,
                sattr->ia_valid |= ATTR_MTIME;
 
        /* Except MODE, it seems harmless of setting twice. */
-       if ((attrset[1] & FATTR4_WORD1_MODE))
+       if (opendata->o_arg.createmode != NFS4_CREATE_EXCLUSIVE &&
+               attrset[1] & FATTR4_WORD1_MODE)
                sattr->ia_valid &= ~ATTR_MODE;
 
        if (attrset[2] & FATTR4_WORD2_SECURITY_LABEL)
@@ -2729,6 +2726,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
        ret = PTR_ERR(state);
        if (IS_ERR(state))
                goto out;
+       ctx->state = state;
        if (server->caps & NFS_CAP_POSIX_LOCK)
                set_bit(NFS_STATE_POSIX_LOCKS, &state->flags);
        if (opendata->o_res.rflags & NFS4_OPEN_RESULT_MAY_NOTIFY_LOCK)
@@ -2754,7 +2752,6 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
        if (ret != 0)
                goto out;
 
-       ctx->state = state;
        if (d_inode(dentry) == state->inode) {
                nfs_inode_attach_open_context(ctx);
                if (read_seqcount_retry(&sp->so_reclaim_seqcount, seq))
@@ -5068,7 +5065,7 @@ out:
  */
 static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t buflen)
 {
-       struct page *pages[NFS4ACL_MAXPAGES] = {NULL, };
+       struct page *pages[NFS4ACL_MAXPAGES + 1] = {NULL, };
        struct nfs_getaclargs args = {
                .fh = NFS_FH(inode),
                .acl_pages = pages,
@@ -5082,13 +5079,9 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu
                .rpc_argp = &args,
                .rpc_resp = &res,
        };
-       unsigned int npages = DIV_ROUND_UP(buflen, PAGE_SIZE);
+       unsigned int npages = DIV_ROUND_UP(buflen, PAGE_SIZE) + 1;
        int ret = -ENOMEM, i;
 
-       /* As long as we're doing a round trip to the server anyway,
-        * let's be prepared for a page of acl data. */
-       if (npages == 0)
-               npages = 1;
        if (npages > ARRAY_SIZE(pages))
                return -ERANGE;
 
@@ -8490,6 +8483,7 @@ nfs4_layoutget_handle_exception(struct rpc_task *task,
                goto out;
        }
 
+       nfs4_sequence_free_slot(&lgp->res.seq_res);
        err = nfs4_handle_exception(server, nfs4err, exception);
        if (!status) {
                if (exception->retry)