lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 19 Oct 2020 21:37:01 -0600
From:   Andreas Dilger <adilger@...ger.ca>
To:     Chunguang Xu <brookxu.cn@...il.com>
Cc:     Ted Tso <tytso@....edu>,
        Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH v2 1/8] ext4: use ASSERT() to replace J_ASSERT()

On Oct 19, 2020, at 3:02 AM, Chunguang Xu <brookxu.cn@...il.com> wrote:
> 
> There are currently multiple forms of assertion, such as J_ASSERT().
> J_ASEERT is provided for the jbd module, which is a public module.

(typo) "J_ASSERT()"

> Maybe we should use custom ASSERT() like other file systems, such as
> xfs, which would be better.

My one minor complaint is that "ASSERT()" is a very generic name and is
likely to cause conflicts with ASSERT in other headers.  That said, I
also see many other filesystems using their own ASSERT() macro, so I
guess they are all in private headers only?

Some minor comments/questions below, but not worth changing the patch
unless you think they are important...

You can add:

Reviewed-by: Andreas Dilger <adilger@...ger.ca>

> @@ -185,7 +185,7 @@ static int ext4_init_block_bitmap(struct super_block *sb,
> 	struct ext4_sb_info *sbi = EXT4_SB(sb);
> 	ext4_fsblk_t start, tmp;
> 
> -	J_ASSERT_BH(bh, buffer_locked(bh));
> +	ASSERT(buffer_locked(bh));

I thought J_ASSERT_BH() did something useful, but J_ASSERT_BH() just maps
to J_ASSERT() internally anyway.

> +#define ASSERT(assert)							\
> +do {									\
> +	if (unlikely(!(assert))) {					\
> +		printk(KERN_EMERG					\
> +		       "Assertion failure in %s() at %s:%d: \"%s\"\n",	\

(style) better to use single quotes '%s' to avoid the need to escape \".

Cheers, Andreas






Download attachment "signature.asc" of type "application/pgp-signature" (874 bytes)

Powered by blists - more mailing lists