From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 425ED3ED3B8 for ; Wed, 20 May 2026 14:57:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779289053; cv=none; b=DNNYug7gEwXBg927cco0y6B4Fdu4LvNrytwTEQUKX5Ky3STbLvE2RRPxQmw1dmYt8cDAPH+wG8e9wUgtI5MOTKK4OVz6ZaA8nvPnjVkj5gYddgQhBwQWv0/j7OGEhxTQ5IbzXgdHkgb/lfcbsNNWdc8ME6AQaVqhXZnswrHE9PM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779289053; c=relaxed/simple; bh=fZybg7/5XnF8ACw/mKUBVEf+GwR+ZiQee7fvZhtXPB0=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=Bj6BU8ed6qW/Ysq70smEI5Frt7DxJ6rSjOSB6qhhIGmz5Qq66VD7YUyEeh/Kd725K08p+PvYWd2Eu7vYDwiWPI5dXr8DQz1g0nhSZ5iwhZmwBf8RU/5yJOv0FsDs/curoXwjcu50s/qw8n9xiVjQTZsx0kEdqAldrt0n4RqIjYI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Zt5cUElS; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Zt5cUElS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A623D1F000E9; Wed, 20 May 2026 14:57:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779289052; bh=01/rjSHK8z2/GUlcmBXtqV7yLhyX+uJWegrVRbqbfF4=; h=Subject:To:Cc:From:Date; b=Zt5cUElSwTKlKq0PGzAn6Qp0PXvMOi8p2kMbsFq9OyhEdl7OFP0dlWVzN+q1hZDbO MukcaE+i1OylHxEAHLuT0qjKERrtzCNb2KZeluKB093CuyFtglmxOTrP/+OSP4lvgP hXKldxroS+XfGDVbRHRvEtdFd3msBM8KG8MDQOJI= Subject: FAILED: patch "[PATCH] nfsd: update mtime/ctime on COPY in presence of delegated" failed to apply to 6.18-stable tree To: okorniev@redhat.com,chuck.lever@oracle.com Cc: From: Date: Wed, 20 May 2026 16:57:35 +0200 Message-ID: <2026052035-dill-stubbly-d0e3@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.18-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y git checkout FETCH_HEAD git cherry-pick -x 4183cf383b6faec17a0882b84cd2d901dba62b16 # git commit -s git send-email --to '' --in-reply-to '2026052035-dill-stubbly-d0e3@gregkh' --subject-prefix 'PATCH 6.18.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 4183cf383b6faec17a0882b84cd2d901dba62b16 Mon Sep 17 00:00:00 2001 From: Olga Kornievskaia Date: Fri, 10 Apr 2026 12:09:20 -0400 Subject: [PATCH] nfsd: update mtime/ctime on COPY in presence of delegated attributes When delegated attributes are given on open, the file is opened with NOCMTIME and modifying operations do not update mtime/ctime as to not get out-of-sync with the client's delegated view. However, for COPY operation, the server should update its view of mtime/ctime and reflect that in any GETATTR queries. Fixes: e5e9b24ab8fa ("nfsd: freeze c/mtime updates with outstanding WRITE_ATTRS delegation") Cc: stable@vger.kernel.org Signed-off-by: Olga Kornievskaia Signed-off-by: Chuck Lever diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 5de8f37df78a..ab39ec885440 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -2121,8 +2121,10 @@ static int nfsd4_do_async_copy(void *data) set_bit(NFSD4_COPY_F_COMPLETED, ©->cp_flags); trace_nfsd_copy_async_done(copy); - nfsd4_send_cb_offload(copy); atomic_dec(©->cp_nn->pending_async_copies); + if (copy->cp_res.wr_bytes_written > 0 && copy->attr_update) + nfsd_update_cmtime_attr(copy->nf_dst->nf_file, 0); + nfsd4_send_cb_offload(copy); return 0; } @@ -2182,6 +2184,9 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, memcpy(&result->cb_stateid, ©->cp_stateid.cs_stid, sizeof(result->cb_stateid)); dup_copy_fields(copy, async_copy); + if ((READ_ONCE(copy->nf_dst->nf_file->f_mode) & + FMODE_NOCMTIME) != 0) + async_copy->attr_update = true; memcpy(async_copy->cp_cb_offload.co_referring_sessionid.data, cstate->session->se_sessionid.data, NFS4_MAX_SESSIONID_LEN); @@ -2200,6 +2205,10 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, } else { status = nfsd4_do_copy(copy, copy->nf_src->nf_file, copy->nf_dst->nf_file, true); + if ((READ_ONCE(copy->nf_dst->nf_file->f_mode) & + FMODE_NOCMTIME) != 0 && + copy->cp_res.wr_bytes_written > 0) + nfsd_update_cmtime_attr(copy->nf_dst->nf_file, 0); } out: trace_nfsd_copy_done(copy, status); diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 417e9ad9fbb3..9a4124c77e04 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h @@ -752,6 +752,7 @@ struct nfsd4_copy { struct nfsd_file *nf_src; struct nfsd_file *nf_dst; + bool attr_update; copy_stateid_t cp_stateid;