Re: [PATCH v2 03/17] fs: add file_write guard
From: Jan Kara
Date: Mon Nov 16 2026 - 08:13:52 EST
On Mon 16-11-26 12:03:43, Christian Brauner wrote:
> Add a guard for file_start_write() and file_end_write().
>
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Christian Brauner (Amutable) <brauner@xxxxxxxxxx>
OK. Feel free to add:
Reviewed-by: Jan Kara <jack@xxxxxxx>
Honza
> ---
> include/linux/fs.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 0b66a09fb686a..c156a326e8c89 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -2782,6 +2782,11 @@ static inline void file_end_write(struct file *file)
> sb_end_write(file_inode(file)->i_sb);
> }
>
> +DEFINE_GUARD(file_write,
> + struct file *,
> + file_start_write(_T),
> + file_end_write(_T))
> +
> /**
> * kiocb_start_write - get write access to a superblock for async file io
> * @iocb: the io context we want to submit the write with
>
> --
> 2.53.0
>
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR