[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241220102616.atkrgagnew5mf7vh@quack3>
Date: Fri, 20 Dec 2024 11:26:16 +0100
From: Jan Kara <jack@...e.cz>
To: libaokun@...weicloud.com
Cc: linux-ext4@...r.kernel.org, tytso@....edu, adilger.kernel@...ger.ca,
jack@...e.cz, linux-kernel@...r.kernel.org, yi.zhang@...wei.com,
yangerkun@...wei.com, Baokun Li <libaokun1@...wei.com>
Subject: Re: [PATCH 1/5] ext4: replace opencoded ext4_end_io_end() in
ext4_put_io_end()
On Fri 20-12-24 14:07:53, libaokun@...weicloud.com wrote:
> From: Baokun Li <libaokun1@...wei.com>
>
> This reduces duplicate code and ensures that a “potential data loss”
> warning is available if the unwritten conversion fails.
>
> Signed-off-by: Baokun Li <libaokun1@...wei.com>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@...e.cz>
Honza
> ---
> fs/ext4/page-io.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
> index 69b8a7221a2b..f53b018ea259 100644
> --- a/fs/ext4/page-io.c
> +++ b/fs/ext4/page-io.c
> @@ -299,18 +299,13 @@ void ext4_put_io_end_defer(ext4_io_end_t *io_end)
>
> int ext4_put_io_end(ext4_io_end_t *io_end)
> {
> - int err = 0;
> -
> if (refcount_dec_and_test(&io_end->count)) {
> - if (io_end->flag & EXT4_IO_END_UNWRITTEN) {
> - err = ext4_convert_unwritten_io_end_vec(io_end->handle,
> - io_end);
> - io_end->handle = NULL;
> - ext4_clear_io_unwritten_flag(io_end);
> - }
> + if (io_end->flag & EXT4_IO_END_UNWRITTEN)
> + return ext4_end_io_end(io_end);
> +
> ext4_release_io_end(io_end);
> }
> - return err;
> + return 0;
> }
>
> ext4_io_end_t *ext4_get_io_end(ext4_io_end_t *io_end)
> --
> 2.46.1
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists