Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp183628pxb; Thu, 12 Aug 2021 13:52:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNnXvi/lwHM/yY96dt1cnIro5UC41WUbqNQX4DNo461SlAqe73PlQpATblzQKxi7qmwhKy X-Received: by 2002:a17:906:3148:: with SMTP id e8mr5501411eje.240.1628801522806; Thu, 12 Aug 2021 13:52:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628801522; cv=none; d=google.com; s=arc-20160816; b=lDeWzGns0ln+uJRQE3Aijwztb+6niOFIyvn1imYydNiFtfYtNCwK8Y+y9bzFQNLBox Pdn/hkQeWzLmvGAM7eXB5ZBoMeYzZ8kYsk9DO7icJi1AQIzOf7Gtb3HKewAaEbi4EkKc HLVAaQmNiy8soUB8ITcEol8bhznz/WE3/v188cTgtxvYDeWljg+tkOOwOgLCI2PlUqky ZMhVPlNCbTG0oznWs4E8/YLCoz4O+FMN/oZTwCppZdMV7NDKq12aYbabY4KZ7Cw3xZ6A rD5x/RXQugjKta29WfO4tQ4hQ4F/IhNfuBsZnxPuYGYOEw5xVP30bk/keha06pT2moo/ Po1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=m+Kj7IY0HJcpmtbRTOPT4bQwid4k/MFF0Fv7OQxqOaU=; b=TJ27/7jXUeVW7S3xqEjsxUmjwjq3UFUUEFh/GR7Ys19eHe6z6mQiWh5MgbJ9mQURVT k1xII/dzyGLzhWQBgL/SnFRQJpf+ACFdSdKWq6oZX8JKvy1cQRE2qDF5T0YcPo6uMjsf Gpvmjnwc0NvujG/UTSjdVWHhpe/vCS3rXGExIcgRpQK1BpkmNMovvcI/UiePQC20aIKB yO+++mBOLYzOUz0xh60X/hZqG4UOoix0OWRWBYz0ojJwBzlyCkdTika7NMZaTH5TopxV 9k3ZdoDYdMOcf2RZjfRexVn1TnmCPeZ66889Ll1+Uvy1beiqt2q2v+rdxh/gco3zoWZY Bg0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uIZe0Ibz; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x23si3488923ejv.167.2021.08.12.13.51.39; Thu, 12 Aug 2021 13:52:02 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uIZe0Ibz; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236525AbhHLUgi (ORCPT + 99 others); Thu, 12 Aug 2021 16:36:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:35270 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237149AbhHLUgf (ORCPT ); Thu, 12 Aug 2021 16:36:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3F65F6103E; Thu, 12 Aug 2021 20:36:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628800569; bh=RmFGxQfXzDz3U9Ov7558Sj1L2+CQkR4vX9DtlN2wACg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uIZe0Ibzub92QxH6g7FhkwsJZfZYJPlHxG56XDlecDAXhnbrZ1ac0t+EpYFUw+6iD vaFn5SDJPLd4Vx6rY+TP4I7RGbx/J7NlFJidoBv12M6UR5xGItC2R06QtPmlTPzHqJ 7unkcZ7eiksTDPiP5C2+abzH84adw7sX6rC2wrJiaaAOlWdkUJnaEN6eQKyKJGUntj pjwyJ14U6prpPMfnRH7EYKKQt8BcvvZQan/l0HCdHingfR6KDV1oFDlCGrCBnniUoh ONEYN9U7Zu+UDhYRUYMGX0KvhOUFHhJZfOMvS8oj70zPIdb4Jw8bWOmAj39nSyC9Of /7LQtajWVAtVg== Date: Thu, 12 Aug 2021 13:36:07 -0700 From: Jaegeuk Kim To: Yangtao Li Cc: chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] f2fs: warn on when fsck flag is set Message-ID: References: <20210811133733.227456-1-frank.li@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210811133733.227456-1-frank.li@vivo.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/11, Yangtao Li wrote: > 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. Can we add an error history and expose it in sysfs? > > 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