Skip to content

Commit bfce8e4

Browse files
Matvey Kovalevchucklever
authored andcommitted
nfsd: delete unreachable confusing code in nfs4_open_delegation()
op_delegate_type is assigned OPEN_DELEGATE_NONE just before the if-block where condition specifies it not be equal to OPEN_DELEGATE_NONE. Compiler treats the block as unreachable and optimizes it out from the resulting executable. In that aspect commit d08d32e ("nfsd4: return delegation immediately if lease fails") notably makes no difference. Seems it's better to just drop this code instead of fiddling with memory barriers or atomics. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Matvey Kovalev <matvey.kovalev@ispras.ru> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent ccd608e commit bfce8e4

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

fs/nfsd/nfs4state.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6362,11 +6362,6 @@ nfs4_open_delegation(struct svc_rqst *rqstp, struct nfsd4_open *open,
63626362
return;
63636363
out_no_deleg:
63646364
open->op_delegate_type = OPEN_DELEGATE_NONE;
6365-
if (open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS &&
6366-
open->op_delegate_type != OPEN_DELEGATE_NONE) {
6367-
dprintk("NFSD: WARNING: refusing delegation reclaim\n");
6368-
open->op_recall = true;
6369-
}
63706365

63716366
/* 4.1 client asking for a delegation? */
63726367
if (open->op_deleg_want)

0 commit comments

Comments
 (0)