All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ocfs2: ratelimit the 'max lookup times reached' notice
@ 2020-10-01 22:44 ` Mauricio Faria de Oliveira
  0 siblings, 0 replies; 4+ messages in thread
From: Mauricio Faria de Oliveira @ 2020-10-01 22:44 UTC (permalink / raw)
  To: linux-kernel, ocfs2-devel; +Cc: Mark Fasheh, Joel Becker, Joseph Qi

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 <mfo@canonical.com>
---
 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);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2: ratelimit the 'max lookup times reached' notice
@ 2020-10-01 22:44 ` Mauricio Faria de Oliveira
  0 siblings, 0 replies; 4+ messages in thread
From: Mauricio Faria de Oliveira @ 2020-10-01 22:44 UTC (permalink / raw)
  To: linux-kernel, ocfs2-devel; +Cc: Mark Fasheh, Joel Becker, Joseph Qi

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 <mfo@canonical.com>
---
 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);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ocfs2: ratelimit the 'max lookup times reached' notice
  2020-10-01 22:44 ` [Ocfs2-devel] " Mauricio Faria de Oliveira
@ 2020-10-04  3:52   ` Joseph Qi
  -1 siblings, 0 replies; 4+ messages in thread
From: Joseph Qi @ 2020-10-04  3:52 UTC (permalink / raw)
  To: Mauricio Faria de Oliveira, linux-kernel, ocfs2-devel
  Cc: Mark Fasheh, Joel Becker



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 <mfo@canonical.com>

Looks good to me.
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>

> ---
>  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);
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2: ratelimit the 'max lookup times reached' notice
@ 2020-10-04  3:52   ` Joseph Qi
  0 siblings, 0 replies; 4+ messages in thread
From: Joseph Qi @ 2020-10-04  3:52 UTC (permalink / raw)
  To: Mauricio Faria de Oliveira, linux-kernel, ocfs2-devel
  Cc: Mark Fasheh, Joel Becker



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 <mfo@canonical.com>

Looks good to me.
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>

> ---
>  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);
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-04  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-01 22:44 [PATCH] ocfs2: ratelimit the 'max lookup times reached' notice Mauricio Faria de Oliveira
2020-10-01 22:44 ` [Ocfs2-devel] " Mauricio Faria de Oliveira
2020-10-04  3:52 ` Joseph Qi
2020-10-04  3:52   ` [Ocfs2-devel] " Joseph Qi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.