NetBSD Problem Report #55259

From mac@SS.Culver.Net  Thu May 14 04:38:30 2020
Return-Path: <mac@SS.Culver.Net>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 36E241A9213
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 14 May 2020 04:38:30 +0000 (UTC)
Message-Id: <20200514043828.B930E23962A@SS.Culver.Net>
Date: Wed, 13 May 2020 21:38:28 -0700 (PDT)
From: mac@ss.culver.net
Reply-To: mac@culver.net
To: gnats-bugs@NetBSD.org
Subject: newfs_lfs aborts with negative sector number
X-Send-Pr-Version: 3.95

>Number:         55259
>Category:       bin
>Synopsis:       newfs_lfs aborts with negative sector number
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 14 04:40:00 +0000 2020
>Originator:     mac@culver.net
>Release:        NetBSD 9.99.60
>Organization:

>Environment:


System: NetBSD S.Culver.Net 9.99.60 NetBSD 9.99.60 (GENERIC) #0: Thu May 7 04:52:39 UTC 2020 mac@S.Culver.Net:/c/usr/src/sys/arch/evbarm/compile/obj/GENERIC evbarm
Architecture: earmv7hf
Machine: evbarm
>Description:

# dd if=/dev/zero of=/dev/rsd1 bs=256m
dd: /dev/rsd1: end of device
37257+0 records in
37256+0 records out
10000831348736 bytes transferred in 316052.806 secs (31642912 bytes/sec)

[3]  - exit 1     dd if=/dev/zero of=/dev/rsd1 bs=256m

# gpt create /dev/rsd1
# gpt add -t lfs /dev/rsd1

# dmesg|tail
[ 230640.864512] scsibus1 at umass1: 2 targets, 1 lun per target
[ 230640.870413] sd1 at scsibus1 target 0 lun 0: <JMicron, Generic, 8201> disk fixed
[ 230640.880416] sd1: fabricating a geometry
[ 230640.880416] sd1: 9314 GB, 9537536 cyl, 64 head, 32 sec, 512 bytes/sect x 19532873728 sectors
[ 230640.900417] sd1: fabricating a geometry
[ 230640.930422] sd1: GPT GUID: eb60f184-7e96-11ea-880c-503eaa05d6b2
[ 230640.930422] dk0 at sd1: "eb60f18e-7e96-11ea-880c-503eaa05d6b2", 19532873661 blocks at 34, type: lfs
[ 595588.102916] dk0 at sd1 (eb60f18e-7e96-11ea-880c-503eaa05d6b2) deleted
[ 595588.112916] sd1: GPT GUID: 7dfb7a5f-5343-491b-a518-d9c5641114c8
[ 595588.112916] dk0 at sd1: "74b98416-ea2c-4bcd-b591-dcb7844ac861", 19532873661 blocks at 34, type: lfs

# gpt show /dev/rsd1
        start         size  index  contents
            0            1         PMBR
            1            1         Pri GPT header
            2           32         Pri GPT table
           34  19532873661      1  GPT part - NetBSD LFS
  19532873695           32         Sec GPT table
  19532873727            1         Sec GPT header

# newfs_lfs /dev/rdk0
Creating a version 2 LFS64 with roll-forward ident 0xeccfb6b5
WARNING: The LFS64 on-disk format is not final.
WARNING: 64-bit volumes should be used only for testing.
9537535.0MB in 9537535 segments of size 1048576
super-block backups (for fsck -b #) at:
16, 1953286144, 3906572288, -2730076160assertion "daddr > 0" failed: file "/usr/src/sbin/fsck_lfs/segwrite.c", line 1054, function "lfs_writesuper"
zsh: abort (core dumped)  newfs_lfs /dev/rdk0


>How-To-Repeat:
	newfs_lfs on a large drive with gpt partition(s)
>Fix:


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.