mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Kleikamp <dave.kleikamp@oracle.com>
To: Edward Adam Davis <eadavis@qq.com>,
	syzbot+7c808908291a569281a9@syzkaller.appspotmail.com
Cc: axboe@kernel.dk, jfs-discussion@lists.sourceforge.net,
	syzkaller-bugs@googlegroups.com, linux-kernel@vger.kernel.org,
	linux-block@vger.kernel.org, kristian@klausen.dk
Subject: Re: [Jfs-discussion] [PATCH] jfs: check agwidth before calculating the control page level
Date: Wed, 19 Feb 2025 15:20:47 -0600	[thread overview]
Message-ID: <740c57ad-0cbd-4498-8ec9-46a54b204e3d@oracle.com> (raw)
In-Reply-To: <tencent_F56949906EED6EC90C8027D0C6DFD2F84606@qq.com>

Catching up on long-ignored emails.

On 12/3/24 4:22AM, Edward Adam Davis via Jfs-discussion wrote:
> The width in dmapctl of the AG is zero, it trigger a divide error when
> calculating the control page level in dbAllocAG.
> 
> To avoid this issue, add a check for agwidth in dbAllocAG.

This value shouldn't change unless the filesystem is resized. I would 
prefer that the check was made once in dbMount().

Shaggy

> 
> Reported-and-tested-by: syzbot+7c808908291a569281a9@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=7c808908291a569281a9
> Signed-off-by: Edward Adam Davis <eadavis@qq.com>
> ---
>   fs/jfs/jfs_dmap.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
> index f9009e4f9ffd..2377102d9c4c 100644
> --- a/fs/jfs/jfs_dmap.c
> +++ b/fs/jfs/jfs_dmap.c
> @@ -1373,6 +1373,11 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
>   		return (rc);
>   	}
>   
> +	if (!bmp->db_agwidth) {
> +		jfs_error(bmp->db_ipbmap->i_sb, "width in dmapctl of the AG is zero\n");
> +		return -EIO;
> +	}
> +
>   	/* the buffer for the dmap control page that fully describes the
>   	 * allocation group.
>   	 */


  reply	other threads:[~2025-02-19 21:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03  4:02 [syzbot] [jfs?] divide error in dbAllocAG syzbot
2024-12-03  7:56 ` Edward Adam Davis
2024-12-03  8:21   ` syzbot
2024-12-03  8:53 ` Edward Adam Davis
2024-12-03  9:24   ` syzbot
2024-12-03  9:47 ` Edward Adam Davis
2024-12-03 10:24   ` syzbot
2024-12-03 10:22 ` [PATCH] jfs: check agwidth before calculating the control page level Edward Adam Davis
2025-02-19 21:20   ` Dave Kleikamp [this message]
2025-02-20 11:24     ` [PATCH V2] jfs: add sanity check for agwidth in dbMount Edward Adam Davis
2025-02-20 16:21       ` Dave Kleikamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=740c57ad-0cbd-4498-8ec9-46a54b204e3d@oracle.com \
    --to=dave.kleikamp@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=eadavis@qq.com \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=kristian@klausen.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+7c808908291a569281a9@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®