Re: [PATCH v2] fsverity: use WARN_ON_ONCE instead of WARN_ON
From: Christian Brauner
Date: Tue Apr 11 2023 - 04:58:29 EST
On Thu, Apr 06, 2023 at 11:25:25AM -0700, Eric Biggers wrote:
> On Thu, Apr 06, 2023 at 11:15:42AM -0700, Eric Biggers wrote:
> > From: Eric Biggers <ebiggers@xxxxxxxxxx>
> >
> > As per Linus's suggestion
> > (https://lore.kernel.org/r/CAHk-=whefxRGyNGzCzG6BVeM=5vnvgb-XhSeFJVxJyAxAF8XRA@xxxxxxxxxxxxxx),
> > use WARN_ON_ONCE instead of WARN_ON. This barely adds any extra
> > overhead, and it makes it so that if any of these ever becomes reachable
> > (they shouldn't, but that's the point), the logs can't be flooded.
> >
> > Reviewed-by: Chaitanya Kulkarni <kch@xxxxxxxxxx>
> > Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
> > ---
> > fs/verity/enable.c | 4 ++--
> > fs/verity/hash_algs.c | 4 ++--
> > fs/verity/open.c | 2 +-
> > include/linux/fsverity.h | 6 +++---
> > 4 files changed, 8 insertions(+), 8 deletions(-)
>
> Sorry, forgot changelog:
>
> v2: also convert the three WARN_ON in include/linux/fsverity.h
Looks good to me,
Reviewed-by: Christian Brauner <brauner@xxxxxxxxxx>