Received: by 10.213.65.68 with SMTP id h4csp36601imn; Mon, 19 Mar 2018 18:44:04 -0700 (PDT) X-Google-Smtp-Source: AG47ELt1mslwygYWa349V1Qox0dyaiGL3MpEQThAf+lI2g76/wKQtxSRto2TO+wbMJUnROBWw4RT X-Received: by 10.101.90.10 with SMTP id y10mr10666464pgs.34.1521510244650; Mon, 19 Mar 2018 18:44:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521510244; cv=none; d=google.com; s=arc-20160816; b=DzDu3RfVbxJ1DJddZxmY/uiPuQ05qTTxkADun0VgZL9vUtJg6L3BEJg5++ffiVYAcL qB8G3BU3kP0pFootMq7cCZ6nF0O27hQ7tLeJBGzcebqLfjy+osRmAsp85l9xN2pCKqCP YGHqwpnNmuUYPp4rxnYuIMy5nuWQRvp7J9cspvUcFnakjZ8SzJNj2VzBb48vqXHTfZR5 mImEtZ85sh7njRzCVgwbT6wzth+qM67kcIHjhA3MjRdvyAMf+bU3TO+vFy9J5vYyUIhl +Mb9m2QMmhPQiH6/zkXvhK4GrJELwauPms7CoHY0t2NkPxh9xyVaZcWKGC1UFCkk5E1T HxjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=o/DHGcFWH0rNDUJXpeat66flhmvo7NETQB909cLpdA8=; b=Pws6vrvI23CEreyacPBP+T8s8a6zIKNnWkn3zxTnIiFUElIW0mRK7AyblIb/dxrC1y TnCZWjKU7ZNclis5ZeZfVjOnpwcsUaCZhYfoOW7K7EPM/Zr6/UEmSAc0b/vo7DZTPS5Q 6VP/R/S4Pp3ovzGSYHX4sXW+mimA+8ftQXipjnXD7kjrTFTNlUrtZxA/2OktskePMvtH rHThTV77i3TjgSUrJs7VzCdm3Fq3JGHzu/OKefeiyZKmx3EzIpfZ1R/ENmhrvZXX5ixM Qp51qTiznhUqo59F0vzHmBY2Fk1lndvzSg+ALMdzzwSBVB+YSFra5ADJP6aSL7VuazDS JRLA== ARC-Authentication-Results: i=1; mx.google.com; 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 v13si445629pfm.83.2018.03.19.18.43.50; Mon, 19 Mar 2018 18:44:04 -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; 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 S1032222AbeCSSd1 (ORCPT + 99 others); Mon, 19 Mar 2018 14:33:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54216 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032179AbeCSSdS (ORCPT ); Mon, 19 Mar 2018 14:33:18 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DA6D712B9; Mon, 19 Mar 2018 18:33:17 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amir Goldstein , Christoph Hellwig , "Darrick J. Wong" Subject: [PATCH 4.15 31/52] xfs: preserve i_rdev when recycling a reclaimable inode Date: Mon, 19 Mar 2018 19:08:29 +0100 Message-Id: <20180319180736.793938090@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180734.976730813@linuxfoundation.org> References: <20180319180734.976730813@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Amir Goldstein commit acd1d71598f7654b6d7718bcbe979992295c672a upstream. Commit 66f364649d870 ("xfs: remove if_rdev") moved storing of rdev value for special inodes to VFS inodes, but forgot to preserve the value of i_rdev when recycling a reclaimable xfs_inode. This was detected by xfstest overlay/017 with inodex=on mount option and xfs base fs. The test does a lookup of overlay chardev and blockdev right after drop caches. Overlayfs inodes hold a reference on underlying xfs inodes when mount option index=on is configured. If drop caches reclaim xfs inodes, before it relclaims overlayfs inodes, that can sometimes leave a reclaimable xfs inode and that test hits that case quite often. When that happens, the xfs inode cache remains broken (zere i_rdev) until the next cycle mount or drop caches. Fixes: 66f364649d870 ("xfs: remove if_rdev") Signed-off-by: Amir Goldstein Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Greg Kroah-Hartman --- fs/xfs/xfs_icache.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -295,6 +295,7 @@ xfs_reinit_inode( uint32_t generation = inode->i_generation; uint64_t version = inode->i_version; umode_t mode = inode->i_mode; + dev_t dev = inode->i_rdev; error = inode_init_always(mp->m_super, inode); @@ -302,6 +303,7 @@ xfs_reinit_inode( inode->i_generation = generation; inode->i_version = version; inode->i_mode = mode; + inode->i_rdev = dev; return error; }