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]
Message-ID: <e8e1c2b6-90d1-9e24-0942-7887a7914a8c@huawei.com>
Date:   Fri, 10 Mar 2017 09:16:22 +0800
From:   Chao Yu <yuchao0@...wei.com>
To:     Jaegeuk Kim <jaegeuk@...nel.org>, <linux-kernel@...r.kernel.org>,
        <linux-fsdevel@...r.kernel.org>,
        <linux-f2fs-devel@...ts.sourceforge.net>
Subject: Re: [PATCH] f2fs: add fault injection on f2fs_truncate

Hi Jaegeuk,

At a glance, it needs to add one more entry in fault_name as well. :)

Thanks,

On 2017/3/10 7:28, Jaegeuk Kim wrote:
> Inject a fault during f2fs_truncate().
> 
> Signed-off-by: Chao Yu <yuchao0@...wei.com>
> Signed-off-by: Jaegeuk Kim <jaegeuk@...nel.org>
> ---
>  fs/f2fs/f2fs.h | 1 +
>  fs/f2fs/file.c | 6 ++++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 870bb4d9bc65..7edb3bea15a4 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -50,6 +50,7 @@ enum {
>  	FAULT_BLOCK,
>  	FAULT_DIR_DEPTH,
>  	FAULT_EVICT_INODE,
> +	FAULT_TRUNCATE,
>  	FAULT_IO,
>  	FAULT_CHECKPOINT,
>  	FAULT_MAX,
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index 0110c263a705..4ec764ea89bd 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -620,6 +620,12 @@ int f2fs_truncate(struct inode *inode)
>  
>  	trace_f2fs_truncate(inode);
>  
> +#ifdef CONFIG_F2FS_FAULT_INJECTION
> +	if (time_to_inject(F2FS_I_SB(inode), FAULT_TRUNCATE)) {
> +		f2fs_show_injection_info(FAULT_TRUNCATE);
> +		return -EIO;
> +	}
> +#endif
>  	/* we should check inline_data size */
>  	if (!f2fs_may_inline_data(inode)) {
>  		err = f2fs_convert_inline_inode(inode);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ