Merge git://git.linux-nfs.org/pub/linux/nfs-2.6

* git://git.linux-nfs.org/pub/linux/nfs-2.6:
NFSv4: Fix open_to_lock_owner sequenceid allocation...
NFSv4: nfs4_open_confirm must not set the open_owner as confirmed on error
NFS: add newline to kernel warning message in auth_gss code
NFSv4: Fix circular locking dependency in nfs4_kill_renewd
NFS: Fix a possible Oops in fs/nfs/super.c

+32 -18
+20 -14
fs/nfs/nfs4proc.c
··· 741 741 if (data->rpc_status == 0) { 742 742 memcpy(data->o_res.stateid.data, data->c_res.stateid.data, 743 743 sizeof(data->o_res.stateid.data)); 744 + nfs_confirm_seqid(&data->owner->so_seqid, 0); 744 745 renew_lease(data->o_res.server, data->timestamp); 745 746 data->rpc_done = 1; 746 747 } 747 - nfs_confirm_seqid(&data->owner->so_seqid, data->rpc_status); 748 748 nfs_increment_open_seqid(data->rpc_status, data->c_arg.seqid); 749 749 } 750 750 ··· 759 759 /* In case of error, no cleanup! */ 760 760 if (!data->rpc_done) 761 761 goto out_free; 762 - nfs_confirm_seqid(&data->owner->so_seqid, 0); 763 762 state = nfs4_opendata_to_nfs4_state(data); 764 763 if (!IS_ERR(state)) 765 764 nfs4_close_state(&data->path, state, data->o_arg.open_flags); ··· 885 886 /* In case we need an open_confirm, no cleanup! */ 886 887 if (data->o_res.rflags & NFS4_OPEN_RESULT_CONFIRM) 887 888 goto out_free; 888 - nfs_confirm_seqid(&data->owner->so_seqid, 0); 889 889 state = nfs4_opendata_to_nfs4_state(data); 890 890 if (!IS_ERR(state)) 891 891 nfs4_close_state(&data->path, state, data->o_arg.open_flags); ··· 3331 3333 3332 3334 p->arg.fh = NFS_FH(inode); 3333 3335 p->arg.fl = &p->fl; 3336 + if (!(lsp->ls_seqid.flags & NFS_SEQID_CONFIRMED)) { 3337 + p->arg.open_seqid = nfs_alloc_seqid(&lsp->ls_state->owner->so_seqid); 3338 + if (p->arg.open_seqid == NULL) 3339 + goto out_free; 3340 + 3341 + } 3334 3342 p->arg.lock_seqid = nfs_alloc_seqid(&lsp->ls_seqid); 3335 3343 if (p->arg.lock_seqid == NULL) 3336 3344 goto out_free; ··· 3349 3345 memcpy(&p->fl, fl, sizeof(p->fl)); 3350 3346 return p; 3351 3347 out_free: 3348 + if (p->arg.open_seqid != NULL) 3349 + nfs_free_seqid(p->arg.open_seqid); 3352 3350 kfree(p); 3353 3351 return NULL; 3354 3352 } ··· 3367 3361 .rpc_cred = sp->so_cred, 3368 3362 }; 3369 3363 3370 - if (nfs_wait_on_sequence(data->arg.lock_seqid, task) != 0) 3371 - return; 3372 3364 dprintk("%s: begin!\n", __FUNCTION__); 3373 3365 /* Do we need to do an open_to_lock_owner? */ 3374 3366 if (!(data->arg.lock_seqid->sequence->flags & NFS_SEQID_CONFIRMED)) { 3375 - data->arg.open_seqid = nfs_alloc_seqid(&sp->so_seqid); 3376 - if (data->arg.open_seqid == NULL) { 3377 - data->rpc_status = -ENOMEM; 3378 - task->tk_action = NULL; 3379 - goto out; 3380 - } 3367 + if (nfs_wait_on_sequence(data->arg.open_seqid, task) != 0) 3368 + return; 3381 3369 data->arg.open_stateid = &state->stateid; 3382 3370 data->arg.new_lock_owner = 1; 3371 + /* Retest in case we raced... */ 3372 + if (!(data->arg.lock_seqid->sequence->flags & NFS_SEQID_CONFIRMED)) 3373 + goto do_rpc; 3383 3374 } 3375 + if (nfs_wait_on_sequence(data->arg.lock_seqid, task) != 0) 3376 + return; 3377 + data->arg.new_lock_owner = 0; 3378 + do_rpc: 3384 3379 data->timestamp = jiffies; 3385 3380 rpc_call_setup(task, &msg, 0); 3386 - out: 3387 3381 dprintk("%s: done!, ret = %d\n", __FUNCTION__, data->rpc_status); 3388 3382 } 3389 3383 ··· 3419 3413 struct nfs4_lockdata *data = calldata; 3420 3414 3421 3415 dprintk("%s: begin!\n", __FUNCTION__); 3422 - if (data->arg.open_seqid != NULL) 3423 - nfs_free_seqid(data->arg.open_seqid); 3424 3416 if (data->cancelled != 0) { 3425 3417 struct rpc_task *task; 3426 3418 task = nfs4_do_unlck(&data->fl, data->ctx, data->lsp, ··· 3428 3424 dprintk("%s: cancelling lock!\n", __FUNCTION__); 3429 3425 } else 3430 3426 nfs_free_seqid(data->arg.lock_seqid); 3427 + if (data->arg.open_seqid != NULL) 3428 + nfs_free_seqid(data->arg.open_seqid); 3431 3429 nfs4_put_lock_state(data->lsp); 3432 3430 put_nfs_open_context(data->ctx); 3433 3431 kfree(data);
-2
fs/nfs/nfs4renewd.c
··· 133 133 void 134 134 nfs4_kill_renewd(struct nfs_client *clp) 135 135 { 136 - down_read(&clp->cl_sem); 137 136 cancel_delayed_work_sync(&clp->cl_renewd); 138 - up_read(&clp->cl_sem); 139 137 } 140 138 141 139 /*
+11 -1
fs/nfs/super.c
··· 1475 1475 error = PTR_ERR(mntroot); 1476 1476 goto error_splat_super; 1477 1477 } 1478 - if (mntroot->d_inode->i_op != server->nfs_client->rpc_ops->dir_inode_ops) { 1478 + if (mntroot->d_inode->i_op != NFS_SB(s)->nfs_client->rpc_ops->dir_inode_ops) { 1479 1479 dput(mntroot); 1480 1480 error = -ESTALE; 1481 1481 goto error_splat_super; ··· 1826 1826 error = PTR_ERR(mntroot); 1827 1827 goto error_splat_super; 1828 1828 } 1829 + if (mntroot->d_inode->i_op != NFS_SB(s)->nfs_client->rpc_ops->dir_inode_ops) { 1830 + dput(mntroot); 1831 + error = -ESTALE; 1832 + goto error_splat_super; 1833 + } 1829 1834 1830 1835 s->s_flags |= MS_ACTIVE; 1831 1836 mnt->mnt_sb = s; ··· 1903 1898 mntroot = nfs4_get_root(s, &mntfh); 1904 1899 if (IS_ERR(mntroot)) { 1905 1900 error = PTR_ERR(mntroot); 1901 + goto error_splat_super; 1902 + } 1903 + if (mntroot->d_inode->i_op != NFS_SB(s)->nfs_client->rpc_ops->dir_inode_ops) { 1904 + dput(mntroot); 1905 + error = -ESTALE; 1906 1906 goto error_splat_super; 1907 1907 } 1908 1908
+1 -1
net/sunrpc/auth_gss/auth_gss.c
··· 625 625 err = -EINVAL; 626 626 gss_auth->mech = gss_mech_get_by_pseudoflavor(flavor); 627 627 if (!gss_auth->mech) { 628 - printk(KERN_WARNING "%s: Pseudoflavor %d not found!", 628 + printk(KERN_WARNING "%s: Pseudoflavor %d not found!\n", 629 629 __FUNCTION__, flavor); 630 630 goto err_free; 631 631 }