Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 7AB372D73B8 for ; Fri, 17 Apr 2026 20:35:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776458153; cv=none; b=pucyvZ28O6wEMEBWqu6qyRrQWLNK4GJ6a7xSFBidvw46s/d4C8wfd5hIwHCBBV8w9UzQjEw1gtKhYmQ8It4MymxzhJMZGR4V37YZp9P74LI4yYyOH6iUUU0rF3kiaA91nbZcBB3YAq6YGYqZSNv7J+5b6pvUWi0Y8Y/zMQZFhdw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776458153; c=relaxed/simple; bh=9eHtg/dUPFfVjRXUU4psQ/1x9fZ20qYpopczXhkLl/A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lmDdDRelJyWj8pueyYAQRbVZobHoQh5aLXmjD3+WLoddffKo7p0VTs4PqDMqSWif+utIKdyhv1xhozAEiPUQVqzZdn1zRw7Sm8+fcbJnF+5dmhMBcxTM0e73I8Fwf4Ja1Z3e1GF46oiTCFeQYxcOK2k00mADuEgX5KOTxgUL2zk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=aLegbY9u; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="aLegbY9u" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776458151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=rUSgvD5vnP0dmHwvqyX+f+RKTTrihLRjPlW0LCrCBNI=; b=aLegbY9uiPBuXA1pa8rwWR/ELVNZaT7RtpQ/1lwFOTppZZK/tcLoHbXCUxzwmMR/GlRNNb 0qBwhNOsknSnpir26LLcH7bO7Bs5OlusycFCHY7L/Gh51cBpQJjDaNb8QAfpeSQCxQ/ATC vxhxqlQv9VdSoGOd6iJO2ZgGxJyOZJw= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-58-wBEMUu4eOFCBGO3hUE3tpA-1; Fri, 17 Apr 2026 16:35:46 -0400 X-MC-Unique: wBEMUu4eOFCBGO3hUE3tpA-1 X-Mimecast-MFC-AGG-ID: wBEMUu4eOFCBGO3hUE3tpA_1776458145 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2FDF819560BB; Fri, 17 Apr 2026 20:35:45 +0000 (UTC) Received: from okorniev-mac.redhat.com (unknown [10.22.81.224]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 71D191800357; Fri, 17 Apr 2026 20:35:44 +0000 (UTC) From: Olga Kornievskaia To: trondmy@kernel.org, anna@kernel.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH v5 1/1] NFSv4.2: fix CLONE/COPY attrs in presence of delegated attributes Date: Fri, 17 Apr 2026 16:35:43 -0400 Message-ID: <20260417203543.39757-1-okorniev@redhat.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 xfstest generic/407 is failing in 2 ways. It detects that after doing a clone the client does not update it's mtime and it's ctime. CLONE always sends a GETATTR operation and then calls nfs_post_op_update_inode() based on the returned attributes. Because of the delegated attributes the client ignores updating the mtime. Then also, when delegated attributes are present, for the change_attr the server replies with the same values as what the client cached before and thus the generic/407 would flag that. Instead, make sure we invalidate the blocks attr. By adding updating delegated attributes in nfs42_copy_dest_done() both COPY and CLONE would update mtime appropriately. Fixes: e12912d94137 ("NFSv4: Add support for delegated atime and mtime attributes") Signed-off-by: Olga Kornievskaia --v5 change nfs_update_delegated_mtime() placement --v4 this version removes the need for having "NFSv4.2: fix COPY attrs in presence of delegated timestamps" --- fs/nfs/nfs42proc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index 7b3ca68fb4bb..6e195619a232 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -401,6 +401,7 @@ static void nfs42_copy_dest_done(struct file *file, loff_t pos, loff_t len, NFS_INO_INVALID_MTIME | NFS_INO_INVALID_BLOCKS); spin_unlock(&inode->i_lock); + nfs_update_delegated_mtime(inode); } static ssize_t _nfs42_proc_copy(struct file *src, -- 2.52.0