Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2404178pxk; Sat, 3 Oct 2020 20:55:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzin050nw7eMu15HVnY0RRqkwjBsoSmNmoZ8vj4gJnLCzuJy/mNiowgbJWhCuecvH7lIfGj X-Received: by 2002:aa7:ccc8:: with SMTP id y8mr8863069edt.325.1601783743130; Sat, 03 Oct 2020 20:55:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601783743; cv=none; d=google.com; s=arc-20160816; b=huZjGeHzFdNay0mOK5zeQUWzlxol9be3/QV9ZtDldoHm566zNz7o6TqBV90jkh6E5k wM7TogMMpgv0PG8la2PbQavUfpAQAPz4hCxyCl51el0Y3Jcymie2nktypPBpLlpQpmLb 8NFi5Pqdbqdd9trS7o5ZEREuq1+yozvxxmhhDJG4jQJN1KbQjJRApx7yyV0B/MCdJrQ0 8WfldXipBr0JmyviUE3QjtFlwk/9Qvr5JWESU1+RrqVX4PDAVMqZVZqCg2AegxpHClhQ TY1kuWIC5VmRca5ryEW6JY94frpeL/aS1u4Kl3TQxMPagA+RhkEx+bGb56SV1s8wzEaS NWWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=l2GZmjliB5fXeIZqfty1T9+jAj2kHaFn1rWacjry/TE=; b=GAd9GawyyqF0hDjVxpzjuyID1Ww4XJaPSbPudHhgFTH2FOWTi1JbcWiZJNWYKj1MJX LnwjL0ZuRz30U0LYuHCTsqfMIqeARujTfEth/S1asHt6WPJppdW4JboQQ3USreTZWoYL y8GP8icySUsYnNPs3rr1aUb0kvmsTfHwKVKq1DbqZSEAJj9a4FrmXodsxcTR6fA+Aq3z 6xJvphcTzWOl+Ks3AfwV6qAD7vKvrPsn7rtMitfKPH7W8k7jJpHcLy1uoQPj9c7LH92/ FC00gaynC3Ka1je9VWZt+84CSO+1VCaMSNkBK2kGylUCHmRFk2VE46oXjxP6wwDEiEO2 5R+A== 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=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx11si1265048edb.81.2020.10.03.20.55.03; Sat, 03 Oct 2020 20:55:43 -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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726407AbgJDDwV (ORCPT + 99 others); Sat, 3 Oct 2020 23:52:21 -0400 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:56229 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726296AbgJDDwV (ORCPT ); Sat, 3 Oct 2020 23:52:21 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=alimailimapcm10staff010182156082;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0UArvYLs_1601783536; Received: from JosephdeMacBook-Pro.local(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0UArvYLs_1601783536) by smtp.aliyun-inc.com(127.0.0.1); Sun, 04 Oct 2020 11:52:17 +0800 Subject: Re: [PATCH] ocfs2: ratelimit the 'max lookup times reached' notice To: Mauricio Faria de Oliveira , linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com Cc: Mark Fasheh , Joel Becker References: <20201001224417.478263-1-mfo@canonical.com> From: Joseph Qi Message-ID: <85ab91b4-00c3-ce0f-2848-a19464337a56@linux.alibaba.com> Date: Sun, 4 Oct 2020 11:52:16 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201001224417.478263-1-mfo@canonical.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/10/2 06:44, Mauricio Faria de Oliveira wrote: > Running stress-ng on ocfs2 completely fills the kernel log with > 'max lookup times reached, filesystem may have nested directories.' > > Let's ratelimit this message as done with others in the code. > > Test-case: > > # mkfs.ocfs2 --mount local $DEV > # mount $DEV $MNT > # cd $MNT > > # dmesg -C > # stress-ng --dirdeep 1 --dirdeep-ops 1000 > # dmesg | grep -c 'max lookup times reached' > > Before: > > # dmesg -C > # stress-ng --dirdeep 1 --dirdeep-ops 1000 > ... > stress-ng: info: [11116] successful run completed in 3.03s > > # dmesg | grep -c 'max lookup times reached' > 967 > > After: > > # dmesg -C > # stress-ng --dirdeep 1 --dirdeep-ops 1000 > ... > stress-ng: info: [739] successful run completed in 0.96s > > # dmesg | grep -c 'max lookup times reached' > 10 > > # dmesg > [ 259.086086] ocfs2_check_if_ancestor: 1990 callbacks suppressed > [ 259.086092] (stress-ng-dirde,740,1):ocfs2_check_if_ancestor:1091 max lookup times reached, filesystem may have nested directories, src inode: 18007, dest inode: 17940. > ... > > Signed-off-by: Mauricio Faria de Oliveira Looks good to me. Reviewed-by: Joseph Qi > --- > fs/ocfs2/namei.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c > index 3c908e9416af..0043eddabdb8 100644 > --- a/fs/ocfs2/namei.c > +++ b/fs/ocfs2/namei.c > @@ -1095,8 +1095,8 @@ static int ocfs2_check_if_ancestor(struct ocfs2_super *osb, > child_inode_no = parent_inode_no; > > if (++i >= MAX_LOOKUP_TIMES) { > - mlog(ML_NOTICE, "max lookup times reached, filesystem " > - "may have nested directories, " > + mlog_ratelimited(ML_NOTICE, "max lookup times reached, " > + "filesystem may have nested directories, " > "src inode: %llu, dest inode: %llu.\n", > (unsigned long long)src_inode_no, > (unsigned long long)dest_inode_no); >