Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1027613ybe; Wed, 4 Sep 2019 11:21:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnYOJ797Q5VyVnfU2eEmfyka1lCNRfQHJvG11pRZVwwqp06B52HXOEcYZUxEYTXm+BCRGv X-Received: by 2002:a62:e910:: with SMTP id j16mr49064240pfh.123.1567621319713; Wed, 04 Sep 2019 11:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567621319; cv=none; d=google.com; s=arc-20160816; b=aUoYltBBFdyIiJkY2IQeqIYNJrAtYTOCcWSALx9CeM2RSm4R8DLJ/9A144Kbr/+vbx VQoA6CkD060VYYbLcQuVP+QAb1JiTVo9+6Isa6B0j1wOfRmnuakkmsDanbOLHlB6Q5z2 h487tTLhl4U06RqGbGWCADsluvufb4cBhew2Le69Vcv/uaaFHEAHJdaXhvewBgYQ1zXo c7O5t38s8pnW4GhYzWkqHgPSQg15sfS7/DjMhlpn6imAxfpBm9EgO42hhNveVwOGrgNZ j0zLmtzW30QcxYzi88Dj3kC6Jo/w/fgR7DYdcyXSoY2GIJfC1hVUeshrT2CRS6t34XhQ 7s+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sCqwYvmIxuPfzyw8xg+Rw/5bq00N6gH6yuTJBnhcgn8=; b=YZj2buZbRTC2dNHjjzDgzoWTQN7dTXzE8akdx/kFNam7eOqLekR+iGj1TG27JpaSSR cRiStxt5YKRQP7aioUBrpiAlVS2yFA49lt045V9uQeMs6zFihX8R3CN4nkmup69YkftY gleiAQXm5vcj1gH11rVnHCjt9GcXqU3bSOlyaAKoN+A/KcQ/RnISuapa+s0fZ4vAM0sy SelYwhB+8yWX/K9zwFWxkjlp5o6YGHbRSfOgvUofC2OFAlCQeujZc0rm9+DIn9DDO5FZ xG6XSFN07zbb9ph97RNo7SpGlb2/sH+ToyCnaBD3SaufGATDkK1VgQM4DFDH0xbM71tN fSrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TdNJdHkt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a191si17452303pge.93.2019.09.04.11.21.43; Wed, 04 Sep 2019 11:21:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TdNJdHkt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389965AbfIDSJg (ORCPT + 99 others); Wed, 4 Sep 2019 14:09:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:52804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389946AbfIDSJc (ORCPT ); Wed, 4 Sep 2019 14:09:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4650522DBF; Wed, 4 Sep 2019 18:09:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620571; bh=APqCzItaMLRksySs4tnt/4wUpoPJu0C59n8m8Bke+8Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TdNJdHktfkPXqTnZw3KDz/Uz3oKWQ/u3dVoqz5stjSEWrFD7xh2rxk3e8paL7MXGH FTvDfCgJUvnP+MGJahGARdx+EZHsNG6GSLKwXHD/f/HY43a5zBzDyPahzz6va2lq3u 2NKRPUuk105EQJsXZ99C2YgPu1ftVtl2GDZUq+mg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Howells , Sasha Levin Subject: [PATCH 5.2 006/143] afs: Fix off-by-one in afs_rename() expected data version calculation Date: Wed, 4 Sep 2019 19:52:29 +0200 Message-Id: <20190904175314.407816191@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175314.206239922@linuxfoundation.org> References: <20190904175314.206239922@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 37c0bbb3326674940e657118306ac52364314523 ] When afs_rename() calculates the expected data version of the target directory in a cross-directory rename, it doesn't increment it as it should, so it always thinks that the target inode is unexpectedly modified on the server. Fixes: a58823ac4589 ("afs: Fix application of status and callback to be under same lock") Signed-off-by: David Howells Signed-off-by: Sasha Levin --- fs/afs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/afs/dir.c b/fs/afs/dir.c index da9563d62b327..9750ac70f8ffb 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -1807,7 +1807,7 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry, afs_end_vnode_operation(&fc); goto error_rehash; } - new_data_version = new_dvnode->status.data_version; + new_data_version = new_dvnode->status.data_version + 1; } else { new_data_version = orig_data_version; new_scb = &scb[0]; -- 2.20.1