Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4461712pxt; Wed, 11 Aug 2021 06:40:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzT7mGo6pnT75fd5qSbtW889qZrTfk7zcbzwMEjfcHwLFQY39BkVnXYYsGnv5wxmyPEqEkL X-Received: by 2002:a05:6402:198:: with SMTP id r24mr11558263edv.93.1628689242938; Wed, 11 Aug 2021 06:40:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628689242; cv=none; d=google.com; s=arc-20160816; b=L2v8EBryP6Bdq3R+9DF0GfhiU2jI9WmxJ2V3MhuYxUk6jz6B0WZgbZqKz4+HjO3fl8 XM9NeFOCMZrFmFYFNP6j+P86kHpIPuYPrJk0QoUHMUSdnvXvFGVnh/rBl3IzYZlQbNif IKOYddlXjb89Abp3b7TaYKAKOM/oGspGWT3NtjRleKPXRWTNQGV2O7/E1WA4f7qgP9av SULnMvq0rDJYJMFW4omnf1vaQUDi+n0ftHi7an+EjkG2HyL8DMx1NPB9Kg/ZFwg+vr8b s/4B1ZVQMeWT30pGSIPRO/NLisvVl2t9xn7JLWlsAszippYX7I0eiD6zCVyomocbjiJJ vuXg== 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=zlcPRnHZ6BZyWxmBnVq7XrsQKI0MPV06uCFVUZ0+aQ0=; b=q9RozoVtOUJzfrFfDtQkogZiAr00Gby1+P4RbeFgwAp8VaeTPzQU3EWfIXt8Eu/d4Y xQ3n80qw4eetcSy63lw9q1decqnqzSu0uQnmqpj6TgHtk4HMwJtqHhAfrfRZvFYUFzYp LpLH/L69sFLWFF6c/uA3CTl68qsjMq6Vm8ka/7spdNd2fp+zETpflbohZpJ+RSi6CKhF Kwkhme4WWNt36zqczyuc7NjD0P3rUiawe6VQpCRZCiAcx2tPjnS+1lHIMDMyupGD6rNB AvQ9PNRDC3o5uWMvgfsPOseBC9XeMXSqi4HjOfXOkEbNvjlf2N+Pp63zv2L8kZv6wOT/ JwMw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vivo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u19si4741346ejj.614.2021.08.11.06.40.15; Wed, 11 Aug 2021 06:40:42 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231459AbhHKNiB (ORCPT + 99 others); Wed, 11 Aug 2021 09:38:01 -0400 Received: from mail-m17636.qiye.163.com ([59.111.176.36]:20674 "EHLO mail-m17636.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbhHKNiA (ORCPT ); Wed, 11 Aug 2021 09:38:00 -0400 Received: from comdg01144022.vivo.xyz (unknown [218.104.188.165]) by mail-m17636.qiye.163.com (Hmail) with ESMTPA id 86099C401AF; Wed, 11 Aug 2021 21:37:34 +0800 (CST) From: Yangtao Li To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH v3] f2fs: warn on when fsck flag is set Date: Wed, 11 Aug 2021 21:37:33 +0800 Message-Id: <20210811133733.227456-1-frank.li@vivo.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZCBgUCR5ZQVlLVUtZV1 kWDxoPAgseWUFZKDYvK1lXWShZQUhPN1dZLVlBSVdZDwkaFQgSH1lBWUMaTUxWThpPTxgZTEJDSE oYVRMBExYaEhckFA4PWVdZFhoPEhUdFFlBWU9LSFVKSktISkNVS1kG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6MDY6UQw*ND9DLSJMSy4RGg00 Hk4wChJVSlVKTUlDTUNCS05OS0NIVTMWGhIXVR0JGhUQVRcSOw0SDRRVGBQWRVlXWRILWUFZSUpD VUpLT1VKQ0NVSk1OWVdZCAFZQUpMQ0M3Bg++ X-HM-Tid: 0a7b356ebbebd996kuws86099c401af Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SBI_NEED_FSCK is an indicator that fsck.f2fs needs to be triggered, this flag is set in too many places. For some scenes that are not very reproducible, adding stack information will help locate the problem. Signed-off-by: Yangtao Li --- v3: -Remove extra parentheses v2: -Convert to WARN_ON -One more blank fs/f2fs/f2fs.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 67faa43cc141..0d08e31214a3 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -33,7 +33,7 @@ #else #define f2fs_bug_on(sbi, condition) \ do { \ - if (WARN_ON(condition)) \ + if (condition) \ set_sbi_flag(sbi, SBI_NEED_FSCK); \ } while (0) #endif @@ -1999,6 +1999,8 @@ static inline bool is_sbi_flag_set(struct f2fs_sb_info *sbi, unsigned int type) static inline void set_sbi_flag(struct f2fs_sb_info *sbi, unsigned int type) { + WARN_ON(type == SBI_NEED_FSCK); + set_bit(type, &sbi->s_flag); } -- 2.32.0