[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210323090102.fpqa55uys5suodfa@wittgenstein>
Date: Tue, 23 Mar 2021 10:01:02 +0100
From: Christian Brauner <christian.brauner@...ntu.com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: linux-fsdevel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
Jens Axboe <axboe@...nel.dk>,
James Morris <jamorris@...ux.microsoft.com>,
Damien Le Moal <damien.lemoal@....com>,
Chaitanya Kulkarni <chaitanya.kulkarni@....com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hfs/hfsplus: use WARN_ON for sanity check
On Mon, Mar 22, 2021 at 11:32:40PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> gcc warns about a couple of instances in which a sanity check
> exists but the author wasn't sure how to react to it failing,
> which makes it look like a possible bug:
>
> fs/hfsplus/inode.c: In function 'hfsplus_cat_read_inode':
> fs/hfsplus/inode.c:503:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
> 503 | /* panic? */;
> | ^
> fs/hfsplus/inode.c:524:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
> 524 | /* panic? */;
> | ^
> fs/hfsplus/inode.c: In function 'hfsplus_cat_write_inode':
> fs/hfsplus/inode.c:582:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
> 582 | /* panic? */;
> | ^
> fs/hfsplus/inode.c:608:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
> 608 | /* panic? */;
> | ^
> fs/hfs/inode.c: In function 'hfs_write_inode':
> fs/hfs/inode.c:464:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
> 464 | /* panic? */;
> | ^
> fs/hfs/inode.c:485:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
> 485 | /* panic? */;
> | ^
>
> panic() is probably not the correct choice here, but a WARN_ON
> seems appropriate and avoids the compile-time warning.
>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
Thanks!
Reviewed-by: Christian Brauner <christian.brauner@...ntu.com>
Powered by blists - more mailing lists