Re: [PATCH] gfs2: fix hung task in gfs2_jhead_process_page
From: Deepanshu Kartikey
Date: Wed Mar 25 2026 - 19:57:21 EST
On Wed, Mar 25, 2026 at 7:12 AM Andreas Gruenbacher <agruenba@xxxxxxxxxx> wrote:
>
>
> How about something like this?
>
> --- a/fs/gfs2/bmap.c
> +++ b/fs/gfs2/bmap.c
> @@ -2210,7 +2210,7 @@ void gfs2_free_journal_extents(struct gfs2_jdesc *jd)
> * @dblock: The physical block at start of new extent
> * @blocks: Size of extent in fs blocks
> *
> - * Returns: 0 on success or -ENOMEM
> + * Returns: 0 on success, or an error code
> */
>
> static int gfs2_add_jextent(struct gfs2_jdesc *jd, u64 lblock, u64
> dblock, u64 blocks)
> @@ -2219,6 +2219,8 @@ static int gfs2_add_jextent(struct gfs2_jdesc
> *jd, u64 lblock, u64 dblock, u64 b
>
> if (!list_empty(&jd->extent_list)) {
> jext = list_last_entry(&jd->extent_list, struct
> gfs2_journal_extent, list);
> + if (jext->lblock + jext->blocks != lblock)
> + return -EINVAL;
> if ((jext->dblock + jext->blocks) == dblock) {
> jext->blocks += blocks;
> return 0;
>
> Thanks,
> Andreas
>
Thanks for the clarification. It looks good.
I have sent the patch v2
Deepanshu