X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fnfsd%2Fnfs4xdr.c;h=dcd673186944a22f48317c3ecf52e889d1357b86;hb=8cde0776ec1e86c270f65bf482f96288e6bf0023;hp=91fb171d2aceee025712bc4783f2a04e2773255c;hpb=59a49e38711a146dc0bef4837c825b5422335460;p=linux-2.6 diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 91fb171d2a..dcd6731869 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -151,8 +151,7 @@ static u32 *read_buf(struct nfsd4_compoundargs *argp, int nbytes) if (nbytes <= sizeof(argp->tmp)) p = argp->tmp; else { - if (argp->tmpp) - kfree(argp->tmpp); + kfree(argp->tmpp); p = argp->tmpp = kmalloc(nbytes, GFP_KERNEL); if (!p) return NULL; @@ -1210,16 +1209,15 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp) save = resp->p; /* - * Routine for encoding the result of a - * "seqid-mutating" NFSv4 operation. This is - * where seqids are incremented, and the - * replay cache is filled. + * Routine for encoding the result of a "seqid-mutating" NFSv4 operation. This + * is where sequence id's are incremented, and the replay cache is filled. + * Note that we increment sequence id's here, at the last moment, so we're sure + * we know whether the error to be returned is a sequence id mutating error. */ #define ENCODE_SEQID_OP_TAIL(stateowner) do { \ if (seqid_mutating_err(nfserr) && stateowner) { \ - if (stateowner->so_confirmed) \ - stateowner->so_seqid++; \ + stateowner->so_seqid++; \ stateowner->so_replay.rp_status = nfserr; \ stateowner->so_replay.rp_buflen = \ (((char *)(resp)->p - (char *)save)); \ @@ -1367,9 +1365,9 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, if ((buflen -= 4) < 0) goto out_resource; if (exp->ex_flags & NFSEXP_NOSUBTREECHECK) - WRITE32(NFS4_FH_VOLATILE_ANY); + WRITE32(NFS4_FH_PERSISTENT); else - WRITE32(NFS4_FH_VOLATILE_ANY|NFS4_FH_VOL_RENAME); + WRITE32(NFS4_FH_PERSISTENT|NFS4_FH_VOL_RENAME); } if (bmval0 & FATTR4_WORD0_CHANGE) { /* @@ -2477,10 +2475,8 @@ void nfsd4_release_compoundargs(struct nfsd4_compoundargs *args) kfree(args->ops); args->ops = args->iops; } - if (args->tmpp) { - kfree(args->tmpp); - args->tmpp = NULL; - } + kfree(args->tmpp); + args->tmpp = NULL; while (args->to_free) { struct tmpbuf *tb = args->to_free; args->to_free = tb->next;