All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: skip adding a discard command if exists
Date: Tue, 14 Nov 2023 18:45:35 -0800	[thread overview]
Message-ID: <ZVQwz5ubx9LojzEf@google.com> (raw)
In-Reply-To: <4a0e1c6f-12c4-f3dd-bb26-4bf0aee6be4b@kernel.org>

On 11/15, Chao Yu wrote:
> On 2023/11/15 5:24, Jaegeuk Kim wrote:
> > When recovering zoned UFS, sometimes we add the same zone to discard multiple
> > times. Simple workaround is to bypass adding it.
> 
> What about skipping f2fs_bug_on() just for zoned UFS case? so that the check
> condition can still be used for non-zoned UFS case.

Hmm, I've never seen this bug_on before, but even this really happens, it does
not make sense to move forward to create duplicate commands resulting in a loop.

So, the question is, do we really need to check this? Have we hit this before?

> 
> Thanks,
> 
> > 
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> >   fs/f2fs/segment.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> > index 727d016318f9..f4ffd64b44b2 100644
> > --- a/fs/f2fs/segment.c
> > +++ b/fs/f2fs/segment.c
> > @@ -1380,7 +1380,8 @@ static void __insert_discard_cmd(struct f2fs_sb_info *sbi,
> >   			p = &(*p)->rb_right;
> >   			leftmost = false;
> >   		} else {
> > -			f2fs_bug_on(sbi, 1);
> > +			/* Let's skip to add, if exists */
> > +			return;
> >   		}
> >   	}


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: skip adding a discard command if exists
Date: Tue, 14 Nov 2023 18:45:35 -0800	[thread overview]
Message-ID: <ZVQwz5ubx9LojzEf@google.com> (raw)
In-Reply-To: <4a0e1c6f-12c4-f3dd-bb26-4bf0aee6be4b@kernel.org>

On 11/15, Chao Yu wrote:
> On 2023/11/15 5:24, Jaegeuk Kim wrote:
> > When recovering zoned UFS, sometimes we add the same zone to discard multiple
> > times. Simple workaround is to bypass adding it.
> 
> What about skipping f2fs_bug_on() just for zoned UFS case? so that the check
> condition can still be used for non-zoned UFS case.

Hmm, I've never seen this bug_on before, but even this really happens, it does
not make sense to move forward to create duplicate commands resulting in a loop.

So, the question is, do we really need to check this? Have we hit this before?

> 
> Thanks,
> 
> > 
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> >   fs/f2fs/segment.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> > index 727d016318f9..f4ffd64b44b2 100644
> > --- a/fs/f2fs/segment.c
> > +++ b/fs/f2fs/segment.c
> > @@ -1380,7 +1380,8 @@ static void __insert_discard_cmd(struct f2fs_sb_info *sbi,
> >   			p = &(*p)->rb_right;
> >   			leftmost = false;
> >   		} else {
> > -			f2fs_bug_on(sbi, 1);
> > +			/* Let's skip to add, if exists */
> > +			return;
> >   		}
> >   	}

  reply	other threads:[~2023-11-15  2:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 21:24 [f2fs-dev] [PATCH] f2fs: skip adding a discard command if exists Jaegeuk Kim
2023-11-14 21:24 ` Jaegeuk Kim
2023-11-15  1:05 ` [f2fs-dev] " Chao Yu
2023-11-15  1:05   ` Chao Yu
2023-11-15  2:45   ` Jaegeuk Kim [this message]
2023-11-15  2:45     ` Jaegeuk Kim
2023-11-15  6:28     ` Chao Yu
2023-11-15  6:28       ` Chao Yu
2023-11-17 17:41       ` Jaegeuk Kim
2023-11-17 17:41         ` Jaegeuk Kim
2023-11-20  3:19         ` Chao Yu
2023-11-20  3:19           ` Chao Yu
2023-11-30 18:30 ` patchwork-bot+f2fs
2023-11-30 18:30   ` patchwork-bot+f2fs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZVQwz5ubx9LojzEf@google.com \
    --to=jaegeuk@kernel.org \
    --cc=chao@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.