Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2250422ybd; Mon, 24 Jun 2019 03:18:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoZje4D8NmSR2pyq3dg3a182Io/eQIYKO/YWd2tSA6rDOFe0bcT7QAitkUhSa4cegTI2iT X-Received: by 2002:a17:90a:fa12:: with SMTP id cm18mr23788018pjb.137.1561371508789; Mon, 24 Jun 2019 03:18:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561371508; cv=none; d=google.com; s=arc-20160816; b=vs8h7lqQvfipWM8lNqd3EGhRh0yHc31nPw9xZ8OZu7z/hE22UAlxcXV5kIFTw1Vdl3 GzBklEDX7uo96CH6U+2IHl9AgFx7LkQJTt+HmGZrq0A7jihvVK34ucu/6f2CzRWBixYa oI1DVgYthB9dGSHLwgKoJiYikOTcjuvXdXvj1mXnZB1MNU5Mu04ve7wrV9IVkktnJCKo BAJAAIDvAMo2C+3/S+z82FA6SwmPI/xkJTgM+L7stRM3W7Vt/Z2xO1nkSxbQwT/8xQKS YrLrzdJg2I1b/JJ5l3w+LAaPIiN3oNSnM7q+MVnZ8CKsDM2wXPp9ZHFuQv3blUBl8BAe rgtA== 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=e0La7f7m1X1yBtKr4yjktmRGsgTnw2eXbbzN6Re8MjQ=; b=SW7FkcoEfh0p0hbtCBkDdYZtNX23PKkHXRcC8AgIDm8ivktleUX4NfA3TGjC5yl/f0 4irn8EYOqkuFbLb4k50d+OsN22pLM0i9F/qxAWm1ImKLA9jPd2Dqsyw6b8LSH0KR40WS btPAT36trsZCunszWsrBXdPOOK80gQIGNCtfCl5kTO8NvEk5227bVO5OWTLVjgpLb1jK V6249LSIhdid0SOaKzrcGvw0Nk+0WvCbvHwf4bhEPl49whLFL/eQlj8rr+P2WVUz7Tst cphsx0K6T7K6TKn7MDUNe+RrXhE58ttkCtlzoRqCeNnvXKHpntwTyW9QyQvdoaW65Bfk Mr2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gjIko8DP; 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 b144si10334784pfb.136.2019.06.24.03.18.13; Mon, 24 Jun 2019 03:18:28 -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=gjIko8DP; 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 S1729369AbfFXKRf (ORCPT + 99 others); Mon, 24 Jun 2019 06:17:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:55104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730971AbfFXKR1 (ORCPT ); Mon, 24 Jun 2019 06:17:27 -0400 Received: from localhost (f4.8f.5177.ip4.static.sl-reverse.com [119.81.143.244]) (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 DA24E208E4; Mon, 24 Jun 2019 10:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561371446; bh=40PerwcHDL3afshREEfkdHj0tWkUN9N4rfcQBy/ERWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gjIko8DPZeJbqN2FwKfqLuFwn06h10CjuwGv+gSmxoj8MycTdCpm127FmJZBQ6UOK NiTfW3uG31mv8vm1Nkv4Car3/ZsH1t1gQvYHG/JzzXX4nVqEBrZYCXCeq5xqjNmzGh 9VAGr6damlSofkg2SBCIW3Q8vBTrANi7uFkWm6Vg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amir Goldstein , Miklos Szeredi Subject: [PATCH 5.1 105/121] ovl: make i_ino consistent with st_ino in more cases Date: Mon, 24 Jun 2019 17:57:17 +0800 Message-Id: <20190624092326.069500108@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190624092320.652599624@linuxfoundation.org> References: <20190624092320.652599624@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 From: Amir Goldstein commit 6dde1e42f497b2d4e22466f23019016775607947 upstream. Relax the condition that overlayfs supports nfs export, to require that i_ino is consistent with st_ino/d_ino. It is enough to require that st_ino and d_ino are consistent. This fixes the failure of xfstest generic/504, due to mismatch of st_ino to inode number in the output of /proc/locks. Fixes: 12574a9f4c9c ("ovl: consistent i_ino for non-samefs with xino") Cc: # v4.19 Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- fs/overlayfs/inode.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -553,15 +553,15 @@ static void ovl_fill_inode(struct inode int xinobits = ovl_xino_bits(inode->i_sb); /* - * When NFS export is enabled and d_ino is consistent with st_ino - * (samefs or i_ino has enough bits to encode layer), set the same - * value used for d_ino to i_ino, because nfsd readdirplus compares - * d_ino values to i_ino values of child entries. When called from + * When d_ino is consistent with st_ino (samefs or i_ino has enough + * bits to encode layer), set the same value used for st_ino to i_ino, + * so inode number exposed via /proc/locks and a like will be + * consistent with d_ino and st_ino values. An i_ino value inconsistent + * with d_ino also causes nfsd readdirplus to fail. When called from * ovl_new_inode(), ino arg is 0, so i_ino will be updated to real * upper inode i_ino on ovl_inode_init() or ovl_inode_update(). */ - if (inode->i_sb->s_export_op && - (ovl_same_sb(inode->i_sb) || xinobits)) { + if (ovl_same_sb(inode->i_sb) || xinobits) { inode->i_ino = ino; if (xinobits && fsid && !(ino >> (64 - xinobits))) inode->i_ino |= (unsigned long)fsid << (64 - xinobits);