Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'nfs-for-4.18-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client bugfix from Trond Myklebust:
"Fix a NFSv4 file locking regression"

* tag 'nfs-for-4.18-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
NFSv4: Fix _nfs4_do_setlk()

+13 -13
+13 -13
fs/nfs/nfs4proc.c
··· 6466 6466 if (data->arg.new_lock && !data->cancelled) { 6467 6467 data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS); 6468 6468 if (locks_lock_inode_wait(lsp->ls_state->inode, &data->fl) < 0) 6469 - break; 6469 + goto out_restart; 6470 6470 } 6471 - 6472 6471 if (data->arg.new_lock_owner != 0) { 6473 6472 nfs_confirm_seqid(&lsp->ls_seqid, 0); 6474 6473 nfs4_stateid_copy(&lsp->ls_stateid, &data->res.stateid); 6475 6474 set_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags); 6476 - goto out_done; 6477 - } else if (nfs4_update_lock_stateid(lsp, &data->res.stateid)) 6478 - goto out_done; 6479 - 6475 + } else if (!nfs4_update_lock_stateid(lsp, &data->res.stateid)) 6476 + goto out_restart; 6480 6477 break; 6481 6478 case -NFS4ERR_BAD_STATEID: 6482 6479 case -NFS4ERR_OLD_STATEID: 6483 6480 case -NFS4ERR_STALE_STATEID: 6484 6481 case -NFS4ERR_EXPIRED: 6485 6482 if (data->arg.new_lock_owner != 0) { 6486 - if (nfs4_stateid_match(&data->arg.open_stateid, 6483 + if (!nfs4_stateid_match(&data->arg.open_stateid, 6487 6484 &lsp->ls_state->open_stateid)) 6488 - goto out_done; 6489 - } else if (nfs4_stateid_match(&data->arg.lock_stateid, 6485 + goto out_restart; 6486 + } else if (!nfs4_stateid_match(&data->arg.lock_stateid, 6490 6487 &lsp->ls_stateid)) 6491 - goto out_done; 6488 + goto out_restart; 6492 6489 } 6493 - if (!data->cancelled) 6494 - rpc_restart_call_prepare(task); 6495 6490 out_done: 6496 6491 dprintk("%s: done, ret = %d!\n", __func__, data->rpc_status); 6492 + return; 6493 + out_restart: 6494 + if (!data->cancelled) 6495 + rpc_restart_call_prepare(task); 6496 + goto out_done; 6497 6497 } 6498 6498 6499 6499 static void nfs4_lock_release(void *calldata) ··· 6502 6502 6503 6503 dprintk("%s: begin!\n", __func__); 6504 6504 nfs_free_seqid(data->arg.open_seqid); 6505 - if (data->cancelled) { 6505 + if (data->cancelled && data->rpc_status == 0) { 6506 6506 struct rpc_task *task; 6507 6507 task = nfs4_do_unlck(&data->fl, data->ctx, data->lsp, 6508 6508 data->arg.lock_seqid);