NFSv4: Fix typo in lock caching

When caching locks due to holding a file delegation, we must always
check against local locks before sending anything to the server.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

+3 -3
+3 -3
fs/nfs/nfs4proc.c
··· 3071 3071 struct nfs4_client *clp = state->owner->so_client; 3072 3072 int status; 3073 3073 3074 - down_read(&clp->cl_sem); 3075 3074 /* Is this a delegated open? */ 3076 - if (test_bit(NFS_DELEGATED_STATE, &state->flags)) { 3075 + if (NFS_I(state->inode)->delegation_state != 0) { 3077 3076 /* Yes: cache locks! */ 3078 3077 status = do_vfs_lock(request->fl_file, request); 3079 3078 /* ...but avoid races with delegation recall... */ 3080 3079 if (status < 0 || test_bit(NFS_DELEGATED_STATE, &state->flags)) 3081 - goto out; 3080 + return status; 3082 3081 } 3082 + down_read(&clp->cl_sem); 3083 3083 status = nfs4_set_lock_state(state, request); 3084 3084 if (status != 0) 3085 3085 goto out;