From nobody Thu Feb 10 02:10:07 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E438D19A603D for ; Thu, 10 Feb 2022 02:10:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JvKvg4MKRz4XQB for ; Thu, 10 Feb 2022 02:10:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71369180EA for ; Thu, 10 Feb 2022 02:10:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 21A2A772076897 for ; Thu, 10 Feb 2022 02:10:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 21A2A72u076896 for bugs@FreeBSD.org; Thu, 10 Feb 2022 02:10:07 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 261850] Ext2 FileSystem: There is a bug in disk data block allocation Date: Thu, 10 Feb 2022 02:10:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: chenguang.wang@terapines.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644459007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rtNYNQRHGgIqVAjpiVEU/kK4lIPJ/fGj8zu1+wgTGeY=; b=IP9tMQr8VjJ4mEL9KsXONvt7BNORsWcEAKnY6ic4R84lnotuaaAtvTOa247Wuz11Vz9SEB Lm4dB3He6gnnJlo+SalxCmVIrFs55VutmKbgZ38JEXC+ri4ucj94g704fxVPQdLn7LhMvc 4Kv8uHVNOgwXChDMs8hsFr531toopUwGrLQUs08mCL9wQaIxhwD0yoIifOhKy06cQdV/kr AixHgOSNIUXl3sa1StmRiG7jzyBgeC6x3VI8OFQCdg2QA+XjQIc8THNLcb69AIaYxTMOQt vhCfUHj1f7UL0iQedYsYf4LyVt8zWU6jEGZiiZdSFYIk2Oix5j/3JWC0ormjYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644459007; a=rsa-sha256; cv=none; b=qvdhqEPL61oXUXj1vFLHmiZlElsMi90TpR2Ec6l1SX5pGmm0zBEK+iO9EKzDKcPJ+kJL8h F090ns6RMfJV58xYP8dDkVaJ5CZw9o54+ISf8wxblKAU1gS8wZdIYghxsVlsk4dmv27oYX dv+YyIUOqJ0k2ZfofSqtt8g6qqp0qFw92l2M1mx83a/+ylMsS4UWFo633xVJF/KGsjFOc2 gW1OfoX+fq8BuWfmxPHCkQ5u1QP9ymIoN4E5MnY6cmCATFeywjcPH5595Fd3ZNfkJuETHM lZA/XhRqTww6792Sx9o/8jvYAZAzP5gNJEy33nkVQpxZdwAEfLPlJZ15MTPhJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D261850 Bug ID: 261850 Summary: Ext2 FileSystem: There is a bug in disk data block allocation Product: Base System Version: 13.0-STABLE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: chenguang.wang@terapines.com git diff fs/ext2fs/ext2_alloc.c diff --git a/fs/ext2fs/ext2_alloc.c b/fs/ext2fs/ext2_alloc.c index 4c265a1a8..9e05d02de 100644 --- a/fs/ext2fs/ext2_alloc.c +++ b/fs/ext2fs/ext2_alloc.c @@ -1067,7 +1067,7 @@ ext2_alloccg(struct inode *ip, int cg, daddr_t bpref,= int size) start =3D dtogd(fs, bpref) / NBBY; else start =3D 0; - end =3D howmany(fs->e2fs_fpg, NBBY) - start; + end =3D howmany(fs->e2fs_fpg, NBBY); retry: runlen =3D 0; runstart =3D 0; In this function, the variable "start" is the starting position where we traverse the block bitmap of a cylinder group , and the variable "end" is t= he ending position. Therefore, I don't think we should subtract "start" in the process of calculating "end". In fact, I'm not sure if there's something wrong with my understanding.= I would be very grateful if someone could help me=EF=BC=81 --=20 You are receiving this mail because: You are the assignee for the bug.=