linux-stable/fs/hfsplus
Arnd Bergmann 48d9e2e6de hfs/hfsplus: use WARN_ON for sanity check
commit 55d1cbbbb2 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-12 11:59:18 +01:00
..
attributes.c hfsplus: fix crash and filesystem corruption when deleting files 2020-04-10 15:36:20 -07:00
bfind.c
bitmap.c
bnode.c
brec.c
btree.c hfsplus: do not free node before using 2018-11-30 14:56:14 -08:00
catalog.c hfsplus: prevent btree data loss on ENOSPC 2018-10-31 08:54:13 -07:00
dir.c hfsplus: convert to fileattr 2021-04-12 15:04:29 +02:00
extents.c hfsplus: prevent corruption in shrinking truncate 2021-05-14 19:41:32 -07:00
hfsplus_fs.h hfsplus: fix bug causing custom uid and gid being unable to be assigned with mount 2023-01-12 11:58:46 +01:00
hfsplus_raw.h
inode.c hfs/hfsplus: use WARN_ON for sanity check 2023-01-12 11:59:18 +01:00
ioctl.c hfsplus: convert to fileattr 2021-04-12 15:04:29 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile
options.c hfsplus: fix bug causing custom uid and gid being unable to be assigned with mount 2023-01-12 11:58:46 +01:00
part_tbl.c
super.c block: use an on-stack bio in blkdev_issue_flush 2021-01-27 09:51:48 -07:00
tables.c
unicode.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
wrapper.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
xattr.c hfsplus: remove unnecessary oom message 2021-07-01 11:06:06 -07:00
xattr.h
xattr_security.c acl: handle idmapped mounts 2021-01-24 14:27:17 +01:00
xattr_trusted.c acl: handle idmapped mounts 2021-01-24 14:27:17 +01:00
xattr_user.c acl: handle idmapped mounts 2021-01-24 14:27:17 +01:00