NetBSD Problem Report #32321

From yamt@mwd.biglobe.ne.jp  Sat Dec 17 05:34:01 2005
Return-Path: <yamt@mwd.biglobe.ne.jp>
Received: from yamt.dyndns.org (FLA1Aai163.kng.mesh.ad.jp [61.193.102.163])
	by narn.netbsd.org (Postfix) with ESMTP id 5615063B88D
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 17 Dec 2005 05:34:00 +0000 (UTC)
Message-Id: <1134797595.888691.1517.nullmailer@yamt.dyndns.org>
Date: Sat, 17 Dec 2005 14:33:15 +0900
From: yamt@mwd.biglobe.ne.jp
Reply-To: yamt@netbsd.org
To: gnats-bugs@netbsd.org
Subject: DEV_BSIZE/d_secsize confusion
X-Send-Pr-Version: 3.95

>Number:         32321
>Category:       kern
>Synopsis:       DEV_BSIZE/d_secsize confusion
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 17 05:35:00 +0000 2005
>Closed-Date:    Sat Dec 29 11:37:04 +0000 2018
>Last-Modified:  Sat Dec 29 11:37:04 +0000 2018
>Originator:     YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release:        NetBSD 3.99.13
>Organization:

>Environment:


System: NetBSD kaeru 3.99.13 NetBSD 3.99.13 (build.kaeru.xen.nodebug) #34: Mon Dec 12 14:52:57 JST 2005 takashi@kaeru:/home/takashi/work/kernel/build.kaeru.xen.nodebug i386
Architecture: i386
Machine: i386
>Description:

	1. bounds_check_with_label@sys/kern/subr_disk_mbr.c does
	  the following.  it seems incorrect as b_blkno is in DEV_BSIZE
	  and sz is in d_secsize.

		sz = howmany(bp->b_bcount, lp->d_secsize);

		if (bp->b_blkno + sz > p->p_size) {

	2. disklabel(8) seems to take them as in d_secsize and
	  complain "partition %c: partition extends past end of unit".

	  scsipi/{sd,cd}.c also seems to take p_offset as in d_secsize.

	  OTOH, dkwedge_bsdlabel seems to take p_offset and p_size
	  as in DEV_BSIZE.

>How-To-Repeat:
	code inspection.

>Fix:


>Release-Note:

>Audit-Trail:
From: David Laight <david@l8s.co.uk>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/32321: DEV_BSIZE/d_secsize confusion
Date: Sat, 17 Dec 2005 12:09:42 +0000

 On Sat, Dec 17, 2005 at 05:35:00AM +0000, yamt@mwd.biglobe.ne.jp wrote:
 > >Synopsis:       DEV_BSIZE/d_secsize confusion

 Support for disks with sectors sizes other than 512 bytes is broken in
 many, many places.

 Not the least of the problems is deciding which structures need to be
 on 512 byte boundaries, and which on physical sector boundaries.

 For example it you be extremely useful if a filesytem could be byte copied
 from a disk with 2k sectors to one with 512 byte sectors.
 (The reverse would not work (for UFS) unless the fragments size were >=2k.)

 I also do not know the layout used for MBR (and extended partitions) on
 disks with large sector sizes.

 	David

 -- 
 David Laight: david@l8s.co.uk

From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/32321: DEV_BSIZE/d_secsize confusion
Date: Sun, 18 Dec 2005 15:01:13 +0900

 >  > >Synopsis:       DEV_BSIZE/d_secsize confusion
 >  
 >  Support for disks with sectors sizes other than 512 bytes is broken in
 >  many, many places.

 sure.  i don't claim this PR is exhaustive. :-)

 YAMAMOTO Takashi

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 12 Feb 2011 19:55:59 +0000
State-Changed-Why:
Is this fully fixed nowadays?


State-Changed-From-To: feedback->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sat, 29 Dec 2018 11:37:04 +0000
State-Changed-Why:
mlelstv believes this bug should be fixed, however he doesn't rule out that there were regressions since he last checked.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.