From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2FBBC54FC9 for ; Tue, 21 Apr 2020 17:14:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF9AB206D5 for ; Tue, 21 Apr 2020 17:14:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587489278; bh=a/2Oqi4uZrcwNbw1zCBjlJJCq+XuGR6b2MmMtiXCdGs=; h=Subject:To:Cc:From:Date:List-ID:From; b=O3UmtbMITgaqUALB6tv68kCpHVxTOfIacSZHO71ZNYDF+T+fuCLsi/Rsxve+xH54F Tpoi5HEkW3VLGdLPlUBaq9uLwCyyILK9qNH/j35U1sX5P3Xzz4b9weSdGsGlEQAbWd 3zCYTixIryCLHlq58Typ2Acbpzf87JdxNQzDZrfU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726709AbgDUROi (ORCPT ); Tue, 21 Apr 2020 13:14:38 -0400 Received: from forward1-smtp.messagingengine.com ([66.111.4.223]:46201 "EHLO forward1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbgDUROi (ORCPT ); Tue, 21 Apr 2020 13:14:38 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.nyi.internal (Postfix) with ESMTP id DA2711940813; Tue, 21 Apr 2020 13:14:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 21 Apr 2020 13:14:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Dc5/M8 oO2JoQCcp05rdH0nWYPPTxUszq34tXe5QdhHo=; b=V+/LRHS6l2OFFywgsqH+jY /gx90wES7i25+sURpqhst2dLWgAPzpSg2zjf1vdctN74Iz+tEKn9bvMZuUsU2lI7 VVW6K6vzRdBHsHMN09FZe2fYVqOrm/DCovOZe3DMNNUoSyvHXP41aeCjwypqWfUw NmHlBHXGjx08r/iQR1W0cCRo6hHfnU2oQM8cmknJPIQytNxBFqsa7hmPeXLFbui6 wjMD64EeGZA1dSYHnh/yZzLSwRP1STA7GesHQ/6MyU07B4QRy4gzLTIJAUz5yuPm nJ6e+kuEposakfayyEWdVIP8DujqclUcewmkNQpcD8Tcjty0LJe8GC2MDqbW6ZdA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrgeehgddutdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecukfhppeekfedrkeeirdekledruddtjeenucevlhhushhtvghrufhiiigvpedune curfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 35D8E3065C7C; Tue, 21 Apr 2020 13:14:36 -0400 (EDT) Subject: FAILED: patch "[PATCH] afs: Fix afs_d_validate() to set the right directory version" failed to apply to 4.19-stable tree To: dhowells@redhat.com Cc: From: Date: Tue, 21 Apr 2020 19:14:34 +0200 Message-ID: <1587489274218214@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.19-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 . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 40fc81027f892284ce31f8b6de1e497f5b47e71f Mon Sep 17 00:00:00 2001 From: David Howells Date: Sat, 11 Apr 2020 08:50:45 +0100 Subject: [PATCH] afs: Fix afs_d_validate() to set the right directory version If a dentry's version is somewhere between invalid_before and the current directory version, we should be setting it forward to the current version, not backwards to the invalid_before version. Note that we're only doing this at all because dentry::d_fsdata isn't large enough on a 32-bit system. Fix this by using a separate variable for invalid_before so that we don't accidentally clobber the current dir version. Fixes: a4ff7401fbfa ("afs: Keep track of invalid-before version for dentry coherency") Signed-off-by: David Howells diff --git a/fs/afs/dir.c b/fs/afs/dir.c index d6278616fb88..d1e1caa23c8b 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -1032,7 +1032,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags) struct dentry *parent; struct inode *inode; struct key *key; - afs_dataversion_t dir_version; + afs_dataversion_t dir_version, invalid_before; long de_version; int ret; @@ -1084,8 +1084,8 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags) if (de_version == (long)dir_version) goto out_valid_noupdate; - dir_version = dir->invalid_before; - if (de_version - (long)dir_version >= 0) + invalid_before = dir->invalid_before; + if (de_version - (long)invalid_before >= 0) goto out_valid; _debug("dir modified");