Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp933103lqs; Fri, 14 Jun 2024 09:35:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUukvo4rvQ6u6eg6ArmfpDrRpt23fIUDSOQWoVHGO0vUoee1+q2BYWjsbhCt46QR9TlyJRjUsOGLHmAkqBOx6/9G6hW1cbz5NKuma5w9A== X-Google-Smtp-Source: AGHT+IEfRcf9YsLOmnWJz9LYBpRgP+YUEJMFRRn3f+9sy3eMS9GzPuX6tuuLagLcov6saSjiSYn6 X-Received: by 2002:a05:6214:a42:b0:6b0:86ab:fe89 with SMTP id 6a1803df08f44-6b2afcd9b5fmr29935006d6.33.1718382950810; Fri, 14 Jun 2024 09:35:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718382950; cv=pass; d=google.com; s=arc-20160816; b=P0syXqE8YrE3BPz/H0J9jBfLBiJOX9Oy6G3Exx7oeVFiauyULsGDLFi53fgT7Tyk8Z WN8G2aAAXTF535SNNg+AkkURC13vQXnUEPgVikwIlFeLN5K6hfSPMW1+BXd7eQKvUWLJ dwK4eohYvaV9HYNX5hIz4Gbl0EDG4Fr+UGf1cJ9H+vH7Ikx3fOeL5tsOMvOz82QJ+hYx MRi9weR7wlZaozZbez3DVw9C70kXI+ZPdyqzS5PBZn9XomyCzjs4Ip6NxJcQd8dth6oi DAkij6sJvAnNlmDisegebmPlsisxBZXyJVKYMiaU3BOQC8hLZ/PzqU5s+4q6Ds7kHa+6 uOwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=BsaX8JplKRwyUTrUkFXo//5qONmSRfVNORPk4eeZ/m4=; fh=e8l1pocnbFogB9/xfJtiNFZwuLTslPmxa3AblXJ83B0=; b=zxw7Oe5Sa0wa0/0LP7dFIRxP2/HWZpCb9Kz7qhhbFBPmDT3WKFEMKWWatNKvcHAm3d nJwlXGzSJMO/5sRYF/82jBSpIE/uO25l1ztWCQ0HQ/UzkIZQWyCmACgGydz98LHSsyyS x6NZ+qhXAKtv+d93j+Ymcsm17n/05Neu9fTL2CHRUTkQDHV1tbtmleXNyA5nhoyjcJ3O vLzFdSnHrKnge2YSKuYirSIb3cmd1EtQAgLN3rzwLl4F49jchOKBGZcYjoobONjNeHsD hzd/c355HVr4iU2FAoGIqrwjomQKIlvpKKpk7xTnJHuyxm/pE9xgzznBN0ZRMLBrE8c2 8GjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GOhoWccc; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-nfs+bounces-3839-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3839-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6b2a5b2a15dsi41684806d6.334.2024.06.14.09.35.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 09:35:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3839-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GOhoWccc; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-nfs+bounces-3839-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3839-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2208A1C24728 for ; Fri, 14 Jun 2024 16:35:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 523A519CD07; Fri, 14 Jun 2024 16:32:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GOhoWccc" X-Original-To: linux-nfs@vger.kernel.org Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD5DFF503 for ; Fri, 14 Jun 2024 16:32:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718382776; cv=none; b=qKs7I//aqse+epsTLmr+chstDflt0+L38UVpZlzKJiZSJ4tHUkGd5zp7avcKBtdqm+FRxiCy0Va6lYdbai1x9NAQvwDUM0iNCPt1n5IDshqwEBTDUA95dAIb4c4B52PLwmygJmalstphGHo2tmAxHOJyhCIYokiH3/lC+StoXyQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718382776; c=relaxed/simple; bh=C7pGa29c3UJQPU+oRVXy87+T1wudpAy0PNfQZrcHlPA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=iXieBDxPULeW2qji7CC/duesaWl6Fr6uVZy/yVjH3h1K0BaSlkS1hgiEMrriF+geVDzvOIazRnlnc+1W+4z6rpJFAyXT8mIfVJmEFNCg/jR5M2W98nethYdRhDQRRycuU1Y7o4dlcsQ7cC2i/gGk81VJs4qsLBAZCBt/b1va18g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GOhoWccc; arc=none smtp.client-ip=209.85.160.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-43ff9d1e0bbso12795591cf.3 for ; Fri, 14 Jun 2024 09:32:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718382773; x=1718987573; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=BsaX8JplKRwyUTrUkFXo//5qONmSRfVNORPk4eeZ/m4=; b=GOhoWccc8rGG2cPYelEHHq8h0dtj/q7GEglLn4ho1f13srMd/jvuW3cX0Hbd3kf0Sl PsiaTWr968vzN7G7K8NGFlrN9q7A4+irto8xnA+bJ1f3F0ON6IsjOv9mKvq9VvAg534o s9h5TnMtKYSr8q2jV+LR8X47/jMNymVNS3+5AU9AXXwGwpprNO3B3zl2F4nxbqe/3QHT dpXRYRq0aWVY8ufmhdwE5ImFFDQh6PcXANkywwykg/zUWWWCiz2ggWlPcJQecIkv/Vuf 55JY3HlJ4HOqOuY5zCczokUO2dHVKCIRYhaN5At0dY5ZZvhKd+6UT/szPpX7F/yAb5LB Lbxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718382773; x=1718987573; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BsaX8JplKRwyUTrUkFXo//5qONmSRfVNORPk4eeZ/m4=; b=nv2LcdyXh3VvjQGd8L2GKJYFtD3CUJyhyaFB/iNcf88JVwZTfVrX2vSiVw3rJ8oK+E o//fjZdrzXAKLaTC9dS1bt06zH2OI/a7OBSYTg1JyAG1F9sr3/mpirNU2SigyQqsRcWJ vZq3OPz2kz6Eh9WfRzjJvAA3I/ks76WdeGIlKJQJNrG2KlG9r+AwXzmeWY4NMp8o8iSq 7KHbga8joQ9/8C6bBkNQDsqd940I8/Biul2IVESEuGskGgB2Yt7oPMb3LkZyNojUJ9tW fC7XmGg8uw5GcSgzS+WBtsEj0RB3ILdA9RLHBMowag7/LPufI6WdJBKwWk7J795NGz0T Zkpw== X-Gm-Message-State: AOJu0Yy+T3cfwO70Im4kZaOaZ3Zp1g83FMIvIayHzqrxoB8bO/pUFKgN UXHlMXqvYxJ+JehDYdAE4r8AZOPb4eUHdegufSZqg2Gm0puQZmCmqvHzVoOdDv3yTzbn2ZEAYW7 ezsHZeVqQBhY2LlVWR11/Z9LaQUS5jg== X-Received: by 2002:a05:622a:1449:b0:441:78:4e01 with SMTP id d75a77b69052e-44216b37ad6mr38737311cf.56.1718382773587; Fri, 14 Jun 2024 09:32:53 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240613041136.506908-1-trond.myklebust@hammerspace.com> <20240613041136.506908-2-trond.myklebust@hammerspace.com> <20240613041136.506908-3-trond.myklebust@hammerspace.com> <20240613041136.506908-4-trond.myklebust@hammerspace.com> <20240613041136.506908-5-trond.myklebust@hammerspace.com> <20240613041136.506908-6-trond.myklebust@hammerspace.com> <20240613041136.506908-7-trond.myklebust@hammerspace.com> <20240613041136.506908-8-trond.myklebust@hammerspace.com> <20240613041136.506908-9-trond.myklebust@hammerspace.com> <20240613041136.506908-10-trond.myklebust@hammerspace.com> <20240613041136.506908-11-trond.myklebust@hammerspace.com> <20240613041136.506908-12-trond.myklebust@hammerspace.com> <20240613041136.506908-13-trond.myklebust@hammerspace.com> In-Reply-To: <20240613041136.506908-13-trond.myklebust@hammerspace.com> From: Anna Schumaker Date: Fri, 14 Jun 2024 12:32:37 -0400 Message-ID: Subject: Re: [PATCH 12/19] NFSv4: Fix up delegated attributes in nfs_setattr To: trondmy@gmail.com Cc: linux-nfs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Trond, On Thu, Jun 13, 2024 at 12:18=E2=80=AFAM wrote: > > From: Trond Myklebust > > nfs_setattr calls nfs_update_inode() directly, so we have to reset the > m/ctime there. > > Signed-off-by: Trond Myklebust > Signed-off-by: Lance Shelton > Signed-off-by: Trond Myklebust > --- > fs/nfs/inode.c | 43 +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 43 insertions(+) After applying this patch I see a handful of new failures on xfstests: generic/075, generic/086, generic/112, generic/332, generic/346, generic/647, and generic/729. I see the first five on NFS v4.2, but 647 and 729 both fail on v4.1 in addition to v4.2. I hope this helps! Anna > > diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c > index 91c0aeaf6c1e..e03c512c8535 100644 > --- a/fs/nfs/inode.c > +++ b/fs/nfs/inode.c > @@ -605,6 +605,46 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh,= struct nfs_fattr *fattr) > } > EXPORT_SYMBOL_GPL(nfs_fhget); > > +static void > +nfs_fattr_fixup_delegated(struct inode *inode, struct nfs_fattr *fattr) > +{ > + unsigned long cache_validity =3D NFS_I(inode)->cache_validity; > + > + if (!nfs_have_read_or_write_delegation(inode)) > + return; > + > + if (!(cache_validity & NFS_INO_REVAL_FORCED)) > + cache_validity &=3D ~(NFS_INO_INVALID_ATIME > + | NFS_INO_INVALID_CHANGE > + | NFS_INO_INVALID_CTIME > + | NFS_INO_INVALID_MTIME > + | NFS_INO_INVALID_SIZE); > + > + if (!(cache_validity & NFS_INO_INVALID_SIZE)) > + fattr->valid &=3D ~(NFS_ATTR_FATTR_PRESIZE > + | NFS_ATTR_FATTR_SIZE); > + > + if (!(cache_validity & NFS_INO_INVALID_CHANGE)) > + fattr->valid &=3D ~(NFS_ATTR_FATTR_PRECHANGE > + | NFS_ATTR_FATTR_CHANGE); > + > + if (nfs_have_delegated_mtime(inode)) { > + if (!(cache_validity & NFS_INO_INVALID_CTIME)) > + fattr->valid &=3D ~(NFS_ATTR_FATTR_PRECTIME > + | NFS_ATTR_FATTR_CTIME); > + > + if (!(cache_validity & NFS_INO_INVALID_MTIME)) > + fattr->valid &=3D ~(NFS_ATTR_FATTR_PREMTIME > + | NFS_ATTR_FATTR_MTIME); > + > + if (!(cache_validity & NFS_INO_INVALID_ATIME)) > + fattr->valid &=3D ~NFS_ATTR_FATTR_ATIME; > + } else if (nfs_have_delegated_atime(inode)) { > + if (!(cache_validity & NFS_INO_INVALID_ATIME)) > + fattr->valid &=3D ~NFS_ATTR_FATTR_ATIME; > + } > +} > + > void nfs_update_delegated_atime(struct inode *inode) > { > spin_lock(&inode->i_lock); > @@ -2163,6 +2203,9 @@ static int nfs_update_inode(struct inode *inode, st= ruct nfs_fattr *fattr) > */ > nfsi->read_cache_jiffies =3D fattr->time_start; > > + /* Fix up any delegated attributes in the struct nfs_fattr */ > + nfs_fattr_fixup_delegated(inode, fattr); > + > save_cache_validity =3D nfsi->cache_validity; > nfsi->cache_validity &=3D ~(NFS_INO_INVALID_ATTR > | NFS_INO_INVALID_ATIME > -- > 2.45.2 > >