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 6E8D84CCDC7; Fri, 4 Sep 2026 05:43:09 +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=1788500590; cv=none; b=IyiJ8tzfmw8T6JwYSdAlnUn5nQCdU/lw68foFXIXoDaleNJSgCt4/yCmcxbxiNijlCjg6cMOnaYvJhdbLhj73E2kE3yLJ4yjGZHXRII+6tEXJKre8YvK3WWWDSS141NHgiLRhQP+By7R/WPxT5zWY2s6kIlN6xQ9UBADOnQI/ZE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788500590; c=relaxed/simple; bh=z5YpTu1HO+zkCg0IB3fb+5O16RvugSW+edMqw4RpGvI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oyYOoVr/P+FXA/S9yWe6/DPvNzn5Fm6GN9Amxs4QZilSPHRInwhxpqtjdSOPK8jdToWm114VZxTarBN+KEV9lKAP7IHjkzbA1u4MdkkKkvGs4Yfot/nP2W5YhSRMwc9JWt2dNYFgnkLkARdtgCoIJTI0Tqr3kX6J0c76d7R4Px4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fvmdX4Fz; 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="fvmdX4Fz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C85CB1F00A3D; Fri, 4 Sep 2026 05:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788500589; bh=deNXhUqSQyKJPHC7uQ2koeU8DobSaawGkostQc3DnYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fvmdX4FzIhAhxzynV2vw3lZOcjgNQxStxNlCKa939YPKwcPMQgvw7+Iotch1gx/2D +yspdLlUsrlysxQuTGbzVfOK8a30aQtMnxH7Dw2qdhnlse9hlfMK61CAKsIIpb5kQ3 elh9tbMnQCUTfY6Um/XdH2e2cnXExe/WislFhwZM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jeff Layton , Chuck Lever Subject: [PATCH 6.18 109/552] nfsd: Reset write verifier when async COPY writeback fails Date: Fri, 4 Sep 2026 06:54:26 +0200 Message-ID: <20260904045750.377380939@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260904045747.813364717@linuxfoundation.org> References: <20260904045747.813364717@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chuck Lever commit f5cb2276954cb80987a93ef9f9dfbfdbfc0f10b9 upstream. Async COPY captures nn->writeverf at request time and reports it to the client via CB_OFFLOAD after the worker kthread completes. When the post-copy vfs_fsync_range() or filemap_check_wb_err() in _nfsd_copy_file_range() reports an error, the worker correctly leaves NFSD4_COPY_F_COMMITTED clear so that CB_OFFLOAD encodes wr_stable_how as NFS_UNSTABLE, but the server's write verifier is not rotated. A client that receives NFS_UNSTABLE in CB_OFFLOAD follows up with COMMIT to make the copied data durable. With the verifier unchanged, COMMIT returns the same value the client just received via CB_OFFLOAD, and the client concludes the copy is durable -- silently dropping the data whose writeback in fact failed. This violates the UNSTABLE+COMMIT durability contract (RFC 7862 section 15.1, RFC 8881 section 18.32) and matches the bug just fixed in nfsd_vfs_write() and nfsd_commit(). Rotate nn->writeverf at the writeback-failure site. The async COPY worker has no svc_rqst, so commit_reset_write_verifier() is not available here; calling nfsd_reset_write_verifier() directly mirrors the trace-less reset already used by nfsd_file_check_write_error() for the same purpose. Filter out -EAGAIN and -ESTALE, matching commit_reset_write_verifier(), since neither indicates a durable-storage failure. Fixes: eac0b17a77fb ("NFSD add vfs_fsync after async copy is done") Cc: stable@vger.kernel.org Assisted-by: kres:claude-opus-4-7 Reviewed-by: Jeff Layton Link: https://patch.msgid.link/20260522203723.446841-1-cel@kernel.org Signed-off-by: Chuck Lever Signed-off-by: Greg Kroah-Hartman --- fs/nfsd/nfs4proc.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1827,6 +1827,8 @@ static ssize_t _nfsd_copy_file_range(str status = filemap_check_wb_err(dst->f_mapping, since); if (!status) set_bit(NFSD4_COPY_F_COMMITTED, ©->cp_flags); + else if (status != -EAGAIN && status != -ESTALE) + nfsd_reset_write_verifier(copy->cp_nn); } return bytes_copied; }