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.

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 d08d32e6e5c0 ("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>

authored by

Matvey Kovalev and committed by
Chuck Lever
bfce8e42 ccd608e2

-5
-5
fs/nfsd/nfs4state.c
··· 6362 6362 return; 6363 6363 out_no_deleg: 6364 6364 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 - } 6370 6365 6371 6366 /* 4.1 client asking for a delegation? */ 6372 6367 if (open->op_deleg_want)