Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp574600img; Fri, 22 Mar 2019 04:20:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxq/PlFWjAB34qfumc0o4LMc6yH1r0rtskdJ5o/lhRWL71xJPnVmhgBi2jfnQCH/lm0HoSg X-Received: by 2002:a63:2045:: with SMTP id r5mr8243098pgm.394.1553253630228; Fri, 22 Mar 2019 04:20:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553253630; cv=none; d=google.com; s=arc-20160816; b=OFUezD9yFHysDFSYA6xBdTDKH2vWX20mlmah9UjFqixJgggwdTaiyOdDc7r35uqm2Z kLeWC7NbbhtHotIT+c12n08qzzfVsPF3F7sI+grJr0ryC6/ftdtYIEzOvWqvAFV5nJSs LlTg4pBRVBDtDR5Z2e0WorwQSELpF2O6o2/g0pfHpfDcXM1MUDqK9qz26HlGmQIWflUO mkV3I7hvIfPCFbbonaTnDkRVJMoXcztGu1ZJ+pJEMj2at9CG3PhEqJQTX1YhvXn8OTkx l6omVgEwsGIxZLERVr2Joe2lmJMxFDPmfcuMqfU4G4mevO9KHhHp4J9oyBNaPVSLgDUF fOrg== 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=2clHSmuK3E7gnuFcYYESttA2G+KPbpZ6ndOARWjj24w=; b=r/IagfPk1cD3YZeuYsST4EDY+70zmi+qY9RsxQGd2gVFtW9JIiWyU8vCZMVlORB0GS qUf0hxnTcsGRmQNUtP27YhG8/gqDPY83HGO3r6y9yR11J5ZEg6oEcPWnp7I3sVptDeop ZI/zPOm+fiBKZ60EXj3ts1K+aAQdKais2Ds5WckyTbEvgb71736db4wnjjJSU0SrEfYn IQWQV9MufPmn156CfHjB1qnCMsBQYs9e4vVW0KYNb4f1xeHnJ0iC/n9TEcC6yhz3EDqh R2wEDdB78xWg583SUWh/1HGxcnjcVseCsl15ApXVUl2ArTE0B8+FVdhffHPnSR2wesns bc9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sdYNvhVJ; 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 o86si2937239pfa.270.2019.03.22.04.20.13; Fri, 22 Mar 2019 04:20:30 -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=sdYNvhVJ; 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 S1728136AbfCVLTc (ORCPT + 99 others); Fri, 22 Mar 2019 07:19:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:45886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727957AbfCVLTb (ORCPT ); Fri, 22 Mar 2019 07:19:31 -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 C7DB8218A2; Fri, 22 Mar 2019 11:19:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553253571; bh=GVqepg8j2feKULwFOgRtv40LNGib7ZBrE8EvgO88yPA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sdYNvhVJRm/mXrSpUKaBQrV9fTU9eDplsIIOzn/qQQPwNaJmISRoYOIBy3p4hFfEh 07xAtGc/GeBTj8MUER+JczBZCsvArH9n2yYzhQYX8c8A7HlrGqDbbdFrjY87LYGO83 DeGx9w7wpk00LpoKcL+qpSPbLnhG1YX6tvz/2B/0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Yan, Zheng" , Ilya Dryomov Subject: [PATCH 3.18 001/134] ceph: avoid repeatedly adding inode to mdsc->snap_flush_list Date: Fri, 22 Mar 2019 12:13:34 +0100 Message-Id: <20190322111210.519567556@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111210.465931067@linuxfoundation.org> References: <20190322111210.465931067@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yan, Zheng commit 04242ff3ac0abbaa4362f97781dac268e6c3541a upstream. Otherwise, mdsc->snap_flush_list may get corrupted. Cc: stable@vger.kernel.org Signed-off-by: "Yan, Zheng" Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov Signed-off-by: Greg Kroah-Hartman --- fs/ceph/snap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c @@ -566,7 +566,8 @@ int __ceph_finish_cap_snap(struct ceph_i capsnap->size); spin_lock(&mdsc->snap_flush_lock); - list_add_tail(&ci->i_snap_flush_item, &mdsc->snap_flush_list); + if (list_empty(&ci->i_snap_flush_item)) + list_add_tail(&ci->i_snap_flush_item, &mdsc->snap_flush_list); spin_unlock(&mdsc->snap_flush_lock); return 1; /* caller may want to ceph_flush_snaps */ }