Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2269772pxu; Mon, 7 Dec 2020 01:59:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJx49r8w71y9KQQKAmd9gvn6PA4TvlJr/uC/BNa+7EsYP8WKmmGI5TcukTNf95090CUNQpLk X-Received: by 2002:a17:906:d146:: with SMTP id br6mr17927690ejb.331.1607335155173; Mon, 07 Dec 2020 01:59:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607335155; cv=none; d=google.com; s=arc-20160816; b=NoxuNrBLa//R1FSm4dtiZhxmwgZftyGA/K8gYcMJPgwiv+WVdtlWqzjDEKS0ArwkV6 iAuiIcjMLRj75tj+w51KWSXd9sM+xnxhRbuM9j6nxJUOVUtOfOy3WXgEaO+0njXg1OP6 zHw7fYhZFoXDV0xj7HJQ1b6Megs5kHdo96sbyuogDltQ58T1vgxeycGO9GqbranqIM+z Na86onqSip+E3fh09CF1FugExQYpMi/85Lq93fducSvUBY3TChWKmnjds+kZGk30bKgl X/1el591qgLJyHm+1vO10CV8SVyzxC173gQD5+WfMJAbAOBsN2KLGJA/eKHiSG0oyfsU d0Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=KJFe1QaHxCFRHE5sUFO0KIASBofWpnyneME0Cl6sH1s=; b=cy2CQpdkclTEkNpZqhxcQVr7Jo5ONbOAi5CculTY12gG8xes9TRiTjTD+Pi+eV5itd AEorknIlFIWWWkOsq5vbTpmiIGlRvYntiDkhULlRe3UIEYuVvJ+I9tcmkwICdnDPxHrb d1xyEKBzcckY5ZRUQ5JiSf6QH9BPb7W6gQcYEcETVnVNuH5LQ3TxEy/ATUWUz3H4Sj/f iMhTSMxeXJ5qkQpkj9RZMNOKtfyo9//ov/oaM/Ulq/kuDE3dVRQxNDe2m66pGE74vbav i5dqtGn+TSR3doDZpjSEAibJDYppf9xkV2f0W4nuP0LAGdVfVB6Kk34jkuAoa9awrVnH o6wQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb6si6392061ejb.459.2020.12.07.01.58.52; Mon, 07 Dec 2020 01:59:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726757AbgLGJzq (ORCPT + 99 others); Mon, 7 Dec 2020 04:55:46 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:8716 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbgLGJzp (ORCPT ); Mon, 7 Dec 2020 04:55:45 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CqJYr4FQMzkltR; Mon, 7 Dec 2020 17:54:24 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Mon, 7 Dec 2020 17:54:55 +0800 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH] f2fs: fix to account inline xattr correctly during recovery Date: Mon, 7 Dec 2020 17:54:41 +0800 Message-ID: <20201207095441.73567-1-yuchao0@huawei.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During recovery, we may missed to update inline xattr count correctly, fix it. Signed-off-by: Chao Yu --- fs/f2fs/node.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index e65d73293a3f..3a24423ac65f 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -2594,9 +2594,15 @@ int f2fs_recover_inline_xattr(struct inode *inode, struct page *page) ri = F2FS_INODE(page); if (ri->i_inline & F2FS_INLINE_XATTR) { - set_inode_flag(inode, FI_INLINE_XATTR); + if (!f2fs_has_inline_xattr(inode)) { + set_inode_flag(inode, FI_INLINE_XATTR); + stat_inc_inline_xattr(inode); + } } else { - clear_inode_flag(inode, FI_INLINE_XATTR); + if (f2fs_has_inline_xattr(inode)) { + stat_dec_inline_xattr(inode); + clear_inode_flag(inode, FI_INLINE_XATTR); + } goto update_inode; } -- 2.29.2