]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nfsd: don't abort copies early
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 24 Feb 2021 18:39:50 +0000 (13:39 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Sat, 6 Mar 2021 21:41:48 +0000 (16:41 -0500)
The typical result of the backwards comparison here is that the source
server in a server-to-server copy will return BAD_STATEID within a few
seconds of the copy starting, instead of giving the copy a full lease
period, so the copy_file_range() call will end up unnecessarily
returning a short read.

Fixes: 624322f1adc5 "NFSD add COPY_NOTIFY operation"
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4state.c

index 423fd6683f3ae2612310df33df5a5b7ef46f5bcf..61552e89bd89df8925d8e13ced1c645923c0ef79 100644 (file)
@@ -5389,7 +5389,7 @@ nfs4_laundromat(struct nfsd_net *nn)
        idr_for_each_entry(&nn->s2s_cp_stateids, cps_t, i) {
                cps = container_of(cps_t, struct nfs4_cpntf_state, cp_stateid);
                if (cps->cp_stateid.sc_type == NFS4_COPYNOTIFY_STID &&
-                               cps->cpntf_time > cutoff)
+                               cps->cpntf_time < cutoff)
                        _free_cpntf_state_locked(nn, cps);
        }
        spin_unlock(&nn->s2s_cp_lock);