From patchwork Thu Oct 1 22:44:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauricio Faria de Oliveira X-Patchwork-Id: 11819245 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6578A13B2 for ; Tue, 6 Oct 2020 21:15:38 +0000 (UTC) Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D847206BE for ; Tue, 6 Oct 2020 21:15:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D847206BE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=ocfs2-devel-bounces@oss.oracle.com Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 096LDwu5020879; Tue, 6 Oct 2020 21:15:29 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 33ym34kmv9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 06 Oct 2020 21:15:29 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 096LAA9P176236; Tue, 6 Oct 2020 21:13:28 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userp3030.oracle.com with ESMTP id 33y37xkgy8-1 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Tue, 06 Oct 2020 21:13:28 +0000 Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1kPuH1-00053M-RZ; Tue, 06 Oct 2020 14:13:27 -0700 Received: from aserp3020.oracle.com ([141.146.126.70]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1kO7JS-0001J1-Kd for ocfs2-devel@oss.oracle.com; Thu, 01 Oct 2020 15:44:34 -0700 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 091MiXEr025239 for ; Thu, 1 Oct 2020 22:44:34 GMT Received: from userp2040.oracle.com (userp2040.oracle.com [156.151.31.90]) by aserp3020.oracle.com with ESMTP id 33tfj28hhu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 01 Oct 2020 22:44:34 +0000 Received: from pps.filterd (userp2040.oracle.com [127.0.0.1]) by userp2040.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 091MiWg6030167 for ; Thu, 1 Oct 2020 22:44:33 GMT Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by userp2040.oracle.com with ESMTP id 33sv8x2q85-1 for ; Thu, 01 Oct 2020 22:44:32 +0000 Received: from mail-qv1-f71.google.com ([209.85.219.71]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kO7JI-0000bW-N4 for ocfs2-devel@oss.oracle.com; Thu, 01 Oct 2020 22:44:24 +0000 Received: by mail-qv1-f71.google.com with SMTP id dj20so182213qvb.23 for ; Thu, 01 Oct 2020 15:44:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4UmiMa5+65rn92Pb5tiRXFetQx5vUZvC8lpatLKDrIg=; b=JqK722krrAOmhMDN1kGgAp26WFk/56pBTD5RM+uytuZy1fu5cOTlZOooC55/vxtssO csUmi1FEcieVj+ZNnF8VUA47oxM5jiXURdf+SzF3YHQcFYFxGvexCcnAteYv8X+GsY4Y tIu3uBRMdaM8FiTy6cghvhNgOfKR9etHdyQKk9lnhxIp8jRuBclIZR0qquJJBtYr2cRQ +3Rq5Aetp604tDSI8Yti4izw9BLTno+WJLduJRfpFJqaE3pQf85qVivw+yiwN2ozyYCR YDHWH0hga9UlIMR6nex7zZSCdXKiZKnHUT333fCfBCzeHXbiP0o95LFr3PN5UIuqMkXx 1tfw== X-Gm-Message-State: AOAM531FQX50FgkypJL8rtDW+GvSeGcpkw8vmzBgj4rR+ESdxRh8ydXI nFxRCIk1W0OT9ieABxwG0LmfF6aAikMpIes5nGvwKkqXqaVH3vZLk/l0fiORfMF1ruPbZvFyMgh b/Y6vmP30AQ4QVLfF9CpJTSseb5VR4FzkBOL4658= X-Received: by 2002:ac8:44a7:: with SMTP id a7mr10192750qto.173.1601592263819; Thu, 01 Oct 2020 15:44:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC5f+HxiHqOCRtJqISp6pgF6pi/0P+v1X8FavaTUYtsSJjyki1dqe8i/Jy0juhDtLqtvyfOQ== X-Received: by 2002:ac8:44a7:: with SMTP id a7mr10192737qto.173.1601592263554; Thu, 01 Oct 2020 15:44:23 -0700 (PDT) Received: from localhost.localdomain ([201.82.49.101]) by smtp.gmail.com with ESMTPSA id f24sm7321148qkk.136.2020.10.01.15.44.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 15:44:22 -0700 (PDT) From: Mauricio Faria de Oliveira To: linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com Date: Thu, 1 Oct 2020 19:44:17 -0300 Message-Id: <20201001224417.478263-1-mfo@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-PDR: PASS X-Source-IP: 91.189.89.112 X-ServerName: youngberry.canonical.com X-Proofpoint-SPF-Result: None X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9761 signatures=668680 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 priorityscore=152 suspectscore=0 mlxlogscore=811 lowpriorityscore=0 mlxscore=0 spamscore=0 bulkscore=0 clxscore=187 malwarescore=0 phishscore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010010182 X-Spam: Clean X-Mailman-Approved-At: Tue, 06 Oct 2020 14:13:27 -0700 Subject: [Ocfs2-devel] [PATCH] ocfs2: ratelimit the 'max lookup times reached' notice X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9766 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010060140 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9766 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 clxscore=1015 bulkscore=0 spamscore=0 malwarescore=0 phishscore=0 suspectscore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010060141 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 --- 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);