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: <lq4acfdaiuave42srs6akk3bxmidlaqgxxgdrlgpi6rznxzu5o@2xzkxywc6s2r>
Date: Tue, 4 Nov 2025 13:32:34 +0100
From: Jan Kara <jack@...e.cz>
To: Christian Brauner <brauner@...nel.org>
Cc: linux-fsdevel@...r.kernel.org, 
	Alexander Viro <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.cz>, linux-btrfs@...r.kernel.org, 
	linux-ext4@...r.kernel.org, linux-xfs@...r.kernel.org
Subject: Re: [PATCH RFC 7/8] open: use super write guard in do_ftruncate()

On Tue 04-11-25 13:12:36, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@...nel.org>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  fs/open.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/open.c b/fs/open.c
> index 3d64372ecc67..1d73a17192da 100644
> --- a/fs/open.c
> +++ b/fs/open.c
> @@ -191,12 +191,9 @@ int do_ftruncate(struct file *file, loff_t length, int small)
>  	if (error)
>  		return error;
>  
> -	sb_start_write(inode->i_sb);
> -	error = do_truncate(file_mnt_idmap(file), dentry, length,
> -			    ATTR_MTIME | ATTR_CTIME, file);
> -	sb_end_write(inode->i_sb);
> -
> -	return error;
> +	scoped_guard(super_write, inode->i_sb)
> +		return do_truncate(file_mnt_idmap(file), dentry, length,
> +				   ATTR_MTIME | ATTR_CTIME, file);
>  }
>  
>  int do_sys_ftruncate(unsigned int fd, loff_t length, int small)
> 
> -- 
> 2.47.3
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ