From: Trond Myklebust Date: Mon, 14 Nov 2016 16:19:56 +0000 (-0500) Subject: NFSv4: Don't call close if the open stateid has already been cleared X-Git-Tag: Ubuntu-5.10.0-12.13~11445^2~3 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=5cc7861eb5b425c7a30ff7676a4b9d0ca62d5c76;p=mirror_ubuntu-hirsute-kernel.git NFSv4: Don't call close if the open stateid has already been cleared Ensure we test to see if the open stateid is actually set, before we send a CLOSE. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker --- diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 0b3cdf856333..2d1481eb1929 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -3122,7 +3122,8 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data) } else if (is_rdwr) calldata->arg.fmode |= FMODE_READ|FMODE_WRITE; - if (!nfs4_valid_open_stateid(state)) + if (!nfs4_valid_open_stateid(state) || + test_bit(NFS_OPEN_STATE, &state->flags) == 0) call_close = 0; spin_unlock(&state->owner->so_lock);