Message ID | 20210806081113.276899570@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5754CC19F3C for <stable@archiver.kernel.org>; Fri, 6 Aug 2021 08:19:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37FCC611CE for <stable@archiver.kernel.org>; Fri, 6 Aug 2021 08:19:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244014AbhHFITw (ORCPT <rfc822;stable@archiver.kernel.org>); Fri, 6 Aug 2021 04:19:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:48952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244178AbhHFIT0 (ORCPT <rfc822;stable@vger.kernel.org>); Fri, 6 Aug 2021 04:19:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 62CBE611CE; Fri, 6 Aug 2021 08:19:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628237940; bh=6/hdxhINZsR96j7PxOiNzrGz5TyaWq5RuKIP9PyFVEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=snv+h3iU2snDtDSe93bROC5ezuJciO3vVf536XnoF71qOVsuLGFC6K8CD4YKe3QKj uFXbMTM0woo4B+xe3Z+ZrOTosz9hO0JEVAf+ebsePEUpF8fvZAM1KthUgomnR/nuL3 UzQTl32oIW+tgeiojGskRwZQsAnNyB2pzvUyaO2M= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Filipe Manana <fdmanana@suse.com>, David Sterba <dsterba@suse.com>, Sasha Levin <sashal@kernel.org> Subject: [PATCH 5.10 04/30] btrfs: fix lost inode on log replay after mix of fsync, rename and inode eviction Date: Fri, 6 Aug 2021 10:16:42 +0200 Message-Id: <20210806081113.276899570@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210806081113.126861800@linuxfoundation.org> References: <20210806081113.126861800@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index d3a2bec931ca..f36928efcf92 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -6456,8 +6456,8 @@ void btrfs_log_new_name(struct btrfs_trans_handle *trans, * if this inode hasn't been logged and directory we're renaming it * from hasn't been logged, we don't need to log it */ - if (inode->logged_trans < trans->transid && - (!old_dir || old_dir->logged_trans < trans->transid)) + if (!inode_logged(trans, inode) && + (!old_dir || !inode_logged(trans, old_dir))) return; btrfs_init_log_ctx(&ctx, &inode->vfs_inode);