Commit a2e3965d authored by xu xin's avatar xu xin Committed by Theodore Ts'o

ext4: use BUG_ON instead of if condition followed by BUG

BUG_ON would be better.

This issue was detected with the help of Coccinelle.
Reported-by: default avatarZeal robot <zealci@zte.com.cn>
Reviewed-by: default avatarLukas Czerner <lczerner@redhat.com>
Signed-off-by: default avatarxu xin <xu.xin16@zte.com.cn>
Link: https://lore.kernel.org/r/20211228073252.580296-1-xu.xin16@zte.com.cnSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent da9e4802
...@@ -2400,8 +2400,7 @@ ext4_rec_len_from_disk(__le16 dlen, unsigned blocksize) ...@@ -2400,8 +2400,7 @@ ext4_rec_len_from_disk(__le16 dlen, unsigned blocksize)
static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize) static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize)
{ {
if ((len > blocksize) || (blocksize > (1 << 18)) || (len & 3)) BUG_ON((len > blocksize) || (blocksize > (1 << 18)) || (len & 3));
BUG();
#if (PAGE_SIZE >= 65536) #if (PAGE_SIZE >= 65536)
if (len < 65536) if (len < 65536)
return cpu_to_le16(len); return cpu_to_le16(len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment