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  linux-cve-announce  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:   Wed, 7 Dec 2022 16:26:06 -0500
From:   Eric Whitney <enwlinux@...il.com>
To:     Ye Bin <yebin@...weicloud.com>
Cc:     tytso@....edu, adilger.kernel@...ger.ca,
        linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org,
        jack@...e.cz, Ye Bin <yebin10@...wei.com>
Subject: Re: [PATCH v3 2/3] ext4: record error when detect abnormal
 'i_reserved_data_blocks'

* Ye Bin <yebin@...weicloud.com>:
> From: Ye Bin <yebin10@...wei.com>
> 
> If 'i_reserved_data_blocks' is not cleared which mean something wrong with
> code, free space accounting is likely wrong, according to Jan Kara's advice
> use ext4_error() to record this abnormal let fsck to repair and also we can
> capture this issue.
> 
> Signed-off-by: Ye Bin <yebin10@...wei.com>
> ---
>  fs/ext4/super.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 840e0a614959..41413338c05b 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -1387,10 +1387,10 @@ static void ext4_destroy_inode(struct inode *inode)
>  	}
>  
>  	if (EXT4_I(inode)->i_reserved_data_blocks)
> -		ext4_msg(inode->i_sb, KERN_ERR,
> -			 "Inode %lu (%p): i_reserved_data_blocks (%u) not cleared!",
> -			 inode->i_ino, EXT4_I(inode),
> -			 EXT4_I(inode)->i_reserved_data_blocks);
> +		ext4_error(inode->i_sb,
> +			"Inode %lu (%p): i_reserved_data_blocks (%u) not cleared!",
> +			inode->i_ino, EXT4_I(inode),
> +			EXT4_I(inode)->i_reserved_data_blocks);

It would be better if the arguments to ext4_error after the first were aligned
under "inode->i_sb", as you had in your first version.  That's typical ext4
practice as seen earlier in this function, though this does pass checkpatch.
Otherwise, looks good.

That said, feel free to add:

Reviewed-by: Eric Whitney <enwlinux@...il.com>


>  }
>  
>  static void init_once(void *foo)
> -- 
> 2.31.1
> 

Powered by blists - more mailing lists