Linux NFS development
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Jeff Layton <jlayton@kernel.org>,
	cel@kernel.org, Neil Brown <neilb@suse.de>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH v2 1/5] NFSD: OFFLOAD_CANCEL should mark an async COPY as completed
Date: Sun, 2 Mar 2025 16:40:32 -0500	[thread overview]
Message-ID: <84ef6425-153a-4924-a7d1-cc3134bc6ffd@oracle.com> (raw)
In-Reply-To: <d03e64d0fe6e524fde6bfc7c2d1ac8748b5e4ddf.camel@kernel.org>

On 3/2/25 4:35 PM, Jeff Layton wrote:
> On Sat, 2025-03-01 at 13:31 -0500, cel@kernel.org wrote:
>> From: Chuck Lever <chuck.lever@oracle.com>
>>
>> Update the status of an async COPY operation when it has been
>> stopped. OFFLOAD_STATUS needs to indicate that the COPY is no longer
>> running.
>>
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>> ---
>>  fs/nfsd/nfs4proc.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
>> index f6e06c779d09..9a0e68aa246f 100644
>> --- a/fs/nfsd/nfs4proc.c
>> +++ b/fs/nfsd/nfs4proc.c
>> @@ -1379,8 +1379,11 @@ static void nfs4_put_copy(struct nfsd4_copy *copy)
>>  static void nfsd4_stop_copy(struct nfsd4_copy *copy)
>>  {
>>  	trace_nfsd_copy_async_cancel(copy);
>> -	if (!test_and_set_bit(NFSD4_COPY_F_STOPPED, &copy->cp_flags))
>> +	if (!test_and_set_bit(NFSD4_COPY_F_STOPPED, &copy->cp_flags)) {
>>  		kthread_stop(copy->copy_task);
>> +		copy->nfserr = nfs_ok;
>> +		set_bit(NFSD4_COPY_F_COMPLETED, &copy->cp_flags);
>> +	}
>>  	nfs4_put_copy(copy);
>>  }
>>  
> 
> STOPPED and COMPLETED seem to basically track each other. What's the
> distinction between the two bits? When is one set, but not the other?

IIRC:

COMPLETED means the background COPY is no longer running. It prevents
kthread_stop() from being called more than once on the same kthread.

STOPPED means that the background COPY is no longer running because
something stopped it before it could finish normally -- more or less
this is like being signaled.

We could name it "ABEND" or something else.

-- 
Chuck Lever

  reply	other threads:[~2025-03-02 21:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-01 18:31 [PATCH v2 0/5] Implement referring call lists for CB_OFFLOAD cel
2025-03-01 18:31 ` [PATCH v2 1/5] NFSD: OFFLOAD_CANCEL should mark an async COPY as completed cel
2025-03-02 21:35   ` Jeff Layton
2025-03-02 21:40     ` Chuck Lever [this message]
2025-03-01 18:31 ` [PATCH v2 2/5] NFSD: Shorten CB_OFFLOAD response to NFS4ERR_DELAY cel
2025-03-03 17:45   ` Jeff Layton
2025-03-01 18:31 ` [PATCH v2 3/5] NFSD: Implement CB_SEQUENCE referring call lists cel
2025-03-03 18:05   ` Jeff Layton
2025-03-03 21:33     ` Chuck Lever
2025-03-01 18:31 ` [PATCH v2 4/5] NFSD: Record each NFSv4 call's session slot index cel
2025-03-01 18:31 ` [PATCH v2 5/5] NFSD: Use a referring call list for CB_OFFLOAD cel
2025-03-07 15:00 ` [PATCH v2 0/5] Implement referring call lists " Jeff Layton
2025-03-07 16:00   ` Chuck Lever
2025-03-07 16:07     ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84ef6425-153a-4924-a7d1-cc3134bc6ffd@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=cel@kernel.org \
    --cc=dai.ngo@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox