Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp797764ybe; Fri, 13 Sep 2019 06:32:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1G8sl8nixxkBm8tx1mqG53kgSTujQealw7V3zeCYtkrgxq1j0AN29TH8U0BQgPakyG3vi X-Received: by 2002:a17:906:af98:: with SMTP id mj24mr39246993ejb.199.1568381578763; Fri, 13 Sep 2019 06:32:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568381578; cv=none; d=google.com; s=arc-20160816; b=ANuDTHe9gDAbG0uZ0bvjESycIR6vh3HKhPTolFjJvWDwK/wdMnZh98jhw/5kub5Jkj uX944GnkbnwbBRR2XgemaLuglTrGcFxCkh7Zfj1J9GNm4CoXaeo5KLuvRPsNpPI/3lR4 RyR4hoR7qTGUdddGxBRXVolB34t2BnNdj+D/2wGR3Thyqq2E8LzcCKUH+DxnWinvwt/V JJa8cREBLDzTqlOimnSOGcfY5hYuMByZatIvWHZid0exXb+VaAKMNEtnXOz4lgOBWuRa Ghm/+OM7VxXNZqXJkDV4HqM7FSdUcidxO4A0wTV8DRkJTi2O/d71OOLh+JGjHGPTZGPI l7fw== 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=V/uwlWhBjpf1O3w8jU1t/rawdbe0ADNpRLjd8BVGXmI=; b=aYz5dFFQuZ+MU4t0S12+3wXGtpvyLaajQTt47tw5N7FulBxJlzrixKA7GnAbaT8rcf gceZCnG+0N4RRAtOJ6ncRLI6RsmvwBK6snW0tVYpSKKe8KXrkG5OXshFGUi5tk8W+LbV +4wNInZ4qz0Ypp3zJAG2z+3UflfHv6tvEb5JK80P1tRhaecYc/F7ncMy7dBlxgB9PWni IhDJMljJ1oX8qtAIdmbafGdE2Xl0+EAAkZbG7zSf9eFqT3OKrGrsaQuJpqVyu0oZpzC9 2RKunVUNhrG8EyKP3vzqhf0PAG4z0PSOCUp3QNcpJd7/o3GGfqnACnNQol4bIASsTAS3 OIuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=x8mERr8F; 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 y19si9071330edr.66.2019.09.13.06.32.34; Fri, 13 Sep 2019 06:32:58 -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=x8mERr8F; 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 S2390221AbfIMNS2 (ORCPT + 99 others); Fri, 13 Sep 2019 09:18:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:46032 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390209AbfIMNS1 (ORCPT ); Fri, 13 Sep 2019 09:18:27 -0400 Received: from localhost (unknown [104.132.45.99]) (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 F1882214D8; Fri, 13 Sep 2019 13:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568380706; bh=XQ4AzhUxeDXOpARPpUKyidIwWVKS3TPFELNFLgstuSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x8mERr8FNo0X+4cPQMoXAtLKD1mWdb/q/3GjScBJTj0DmmlzD/YTafbng1SKxQpTf IvchUdEC+VHNPCNJ67K2J3GMp4N0NLshEeR6NgVorTdZgHkHJ4gvv2CC1tLk0M4fTz XZZxY08YUapfJCl8si0Bx110DZRjZcW9sAqHnSnI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Yan, Zheng" , Jeff Layton , Ilya Dryomov , Sasha Levin Subject: [PATCH 4.19 151/190] ceph: use ceph_evict_inode to cleanup inodes resource Date: Fri, 13 Sep 2019 14:06:46 +0100 Message-Id: <20190913130611.980843306@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190913130559.669563815@linuxfoundation.org> References: <20190913130559.669563815@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 87bc5b895d94a0f40fe170d4cf5771c8e8f85d15 ] remove_session_caps() relies on __wait_on_freeing_inode(), to wait for freeing inode to remove its caps. But VFS wakes freeing inode waiters before calling destroy_inode(). Cc: stable@vger.kernel.org Link: https://tracker.ceph.com/issues/40102 Signed-off-by: "Yan, Zheng" Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov Signed-off-by: Sasha Levin --- fs/ceph/inode.c | 7 +++++-- fs/ceph/super.c | 2 +- fs/ceph/super.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 11f19432a74c4..665a86f83f4b0 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -528,13 +528,16 @@ static void ceph_i_callback(struct rcu_head *head) kmem_cache_free(ceph_inode_cachep, ci); } -void ceph_destroy_inode(struct inode *inode) +void ceph_evict_inode(struct inode *inode) { struct ceph_inode_info *ci = ceph_inode(inode); struct ceph_inode_frag *frag; struct rb_node *n; - dout("destroy_inode %p ino %llx.%llx\n", inode, ceph_vinop(inode)); + dout("evict_inode %p ino %llx.%llx\n", inode, ceph_vinop(inode)); + + truncate_inode_pages_final(&inode->i_data); + clear_inode(inode); ceph_fscache_unregister_inode_cookie(ci); diff --git a/fs/ceph/super.c b/fs/ceph/super.c index c5cf46e43f2e7..02528e11bf331 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -827,9 +827,9 @@ static int ceph_remount(struct super_block *sb, int *flags, char *data) static const struct super_operations ceph_super_ops = { .alloc_inode = ceph_alloc_inode, - .destroy_inode = ceph_destroy_inode, .write_inode = ceph_write_inode, .drop_inode = ceph_drop_inode, + .evict_inode = ceph_evict_inode, .sync_fs = ceph_sync_fs, .put_super = ceph_put_super, .remount_fs = ceph_remount, diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 0180193097905..6e968e48e5e4b 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -854,7 +854,7 @@ static inline bool __ceph_have_pending_cap_snap(struct ceph_inode_info *ci) extern const struct inode_operations ceph_file_iops; extern struct inode *ceph_alloc_inode(struct super_block *sb); -extern void ceph_destroy_inode(struct inode *inode); +extern void ceph_evict_inode(struct inode *inode); extern int ceph_drop_inode(struct inode *inode); extern struct inode *ceph_get_inode(struct super_block *sb, -- 2.20.1