mint0x33/fs/hfsplus
Arnd Bergmann f62f5ee630 hfs/hfsplus: use WARN_ON for sanity check
commit 55d1cbbbb29e6656c662ee8f73ba1fc4777532eb upstream.

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.

Link: https://lkml.kernel.org/r/20210927102149.1809384-1-arnd@kernel.org
Link: https://lore.kernel.org/all/20210322223249.2632268-1-arnd@kernel.org/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-18 09:26:41 +01:00
..
acl.h
attributes.c hfsplus: fix crash and filesystem corruption when deleting files 2020-04-24 08:00:45 +02:00
bfind.c
bitmap.c
bnode.c
brec.c hfsplus: fix BUG on bnode parent update 2019-12-01 09:13:53 +01:00
btree.c hfsplus: prevent btree data loss on ENOSPC 2019-12-01 09:13:54 +01:00
catalog.c hfsplus: prevent btree data loss on ENOSPC 2019-12-01 09:13:54 +01:00
dir.c hfsplus: fix NULL dereference in hfsplus_lookup() 2018-09-15 09:45:27 +02:00
extents.c hfsplus: fix return value of hfsplus_get_block() 2019-12-01 09:13:55 +01:00
hfsplus_fs.h hfsplus: fix bug causing custom uid and gid being unable to be assigned with mount 2023-01-18 09:26:35 +01:00
hfsplus_raw.h
inode.c hfs/hfsplus: use WARN_ON for sanity check 2023-01-18 09:26:41 +01:00
ioctl.c
Kconfig
Makefile
options.c hfsplus: fix bug causing custom uid and gid being unable to be assigned with mount 2023-01-18 09:26:35 +01:00
part_tbl.c
posix_acl.c
super.c
tables.c
unicode.c
wrapper.c
xattr.c
xattr.h
xattr_security.c
xattr_trusted.c
xattr_user.c