NFS client bugfixes for Linux 4.18
Highlights include: Bugfixes: - Fix a NFSv4 file locking regression -----BEGIN PGP SIGNATURE----- iQIcBAABAgAGBQJbZFG/AAoJEA4mA3inWBJcyo8P/0MN6eRpDU2VCZheM7DgsN2L a7W/Phc1PjHoaqksQB4Zb3uMYQQCWAyvE/VB5nRJSF1ZQbKvv7kgkyqX+PxEG8LI Pp3igaVXzqkRj3eA33G1HXZCrymjf7sTb4CEdMgSUBe3wLXjrFPP4Og0RJ8YGhCG QBG0ZENwcseUk5bmbSpp9Ac60URy1si1pD1nB3z+zSQT2ViA8QHgzg3Hpwgm+0R7 WG/QzIFoGoJ8J9sDX/tXdkwUT2Z3yusxXcwK7Be5dtUcu1codf+EaPxRNG55myRW J2fY+KIocgQK8lo3w9ok1sGTyN+YkS8eIQqTeZzg0Gty/LX7bwH/3ScCeQtbu9RH nAR2OJQkc/wJ8sJojmUmDnBgskvgWzdfxfxRGQwlnRMD0W3t0LUDCeIUZ/1OL69l 4pgvFLaR5MRD/DS4sSftKcOpgH5KDTlfuUXA+PamELLAk93FWJEZTVI4hmUR02+h /0QoRE6FAraQ7IY9TuLd/Jj3wWmqvataL6JGuWSdmhd35PbRxxBun+5zCyj62BAM /h0SjrCMD+dhotcdiekHINNbNYRG6ukbswgP6zCtuq4icTCW8SMVNyI3mXUVQwF3 hAc3FylKpdGkgSrK3unLnBSeBgGwnCy1PYtusx0MgJf/qhdPYsl0bwgZhcR1U01y WfyGrwoNhLEmxL6+zECQ =gMVX -----END PGP SIGNATURE----- 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()
This commit is contained in:
commit
310810ae19
|
@ -6466,34 +6466,34 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
|
||||||
if (data->arg.new_lock && !data->cancelled) {
|
if (data->arg.new_lock && !data->cancelled) {
|
||||||
data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS);
|
data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS);
|
||||||
if (locks_lock_inode_wait(lsp->ls_state->inode, &data->fl) < 0)
|
if (locks_lock_inode_wait(lsp->ls_state->inode, &data->fl) < 0)
|
||||||
break;
|
goto out_restart;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->arg.new_lock_owner != 0) {
|
if (data->arg.new_lock_owner != 0) {
|
||||||
nfs_confirm_seqid(&lsp->ls_seqid, 0);
|
nfs_confirm_seqid(&lsp->ls_seqid, 0);
|
||||||
nfs4_stateid_copy(&lsp->ls_stateid, &data->res.stateid);
|
nfs4_stateid_copy(&lsp->ls_stateid, &data->res.stateid);
|
||||||
set_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags);
|
set_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags);
|
||||||
goto out_done;
|
} else if (!nfs4_update_lock_stateid(lsp, &data->res.stateid))
|
||||||
} else if (nfs4_update_lock_stateid(lsp, &data->res.stateid))
|
goto out_restart;
|
||||||
goto out_done;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case -NFS4ERR_BAD_STATEID:
|
case -NFS4ERR_BAD_STATEID:
|
||||||
case -NFS4ERR_OLD_STATEID:
|
case -NFS4ERR_OLD_STATEID:
|
||||||
case -NFS4ERR_STALE_STATEID:
|
case -NFS4ERR_STALE_STATEID:
|
||||||
case -NFS4ERR_EXPIRED:
|
case -NFS4ERR_EXPIRED:
|
||||||
if (data->arg.new_lock_owner != 0) {
|
if (data->arg.new_lock_owner != 0) {
|
||||||
if (nfs4_stateid_match(&data->arg.open_stateid,
|
if (!nfs4_stateid_match(&data->arg.open_stateid,
|
||||||
&lsp->ls_state->open_stateid))
|
&lsp->ls_state->open_stateid))
|
||||||
goto out_done;
|
goto out_restart;
|
||||||
} else if (nfs4_stateid_match(&data->arg.lock_stateid,
|
} else if (!nfs4_stateid_match(&data->arg.lock_stateid,
|
||||||
&lsp->ls_stateid))
|
&lsp->ls_stateid))
|
||||||
goto out_done;
|
goto out_restart;
|
||||||
}
|
}
|
||||||
if (!data->cancelled)
|
|
||||||
rpc_restart_call_prepare(task);
|
|
||||||
out_done:
|
out_done:
|
||||||
dprintk("%s: done, ret = %d!\n", __func__, data->rpc_status);
|
dprintk("%s: done, ret = %d!\n", __func__, data->rpc_status);
|
||||||
|
return;
|
||||||
|
out_restart:
|
||||||
|
if (!data->cancelled)
|
||||||
|
rpc_restart_call_prepare(task);
|
||||||
|
goto out_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nfs4_lock_release(void *calldata)
|
static void nfs4_lock_release(void *calldata)
|
||||||
|
@ -6502,7 +6502,7 @@ static void nfs4_lock_release(void *calldata)
|
||||||
|
|
||||||
dprintk("%s: begin!\n", __func__);
|
dprintk("%s: begin!\n", __func__);
|
||||||
nfs_free_seqid(data->arg.open_seqid);
|
nfs_free_seqid(data->arg.open_seqid);
|
||||||
if (data->cancelled) {
|
if (data->cancelled && data->rpc_status == 0) {
|
||||||
struct rpc_task *task;
|
struct rpc_task *task;
|
||||||
task = nfs4_do_unlck(&data->fl, data->ctx, data->lsp,
|
task = nfs4_do_unlck(&data->fl, data->ctx, data->lsp,
|
||||||
data->arg.lock_seqid);
|
data->arg.lock_seqid);
|
||||||
|
|
Loading…
Reference in New Issue