From nobody@FreeBSD.org  Mon Jan 22 17:10:49 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 10D8016A403
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 22 Jan 2007 17:10:48 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id F40CA13C4F8
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 22 Jan 2007 17:10:47 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l0MHAkOP025210
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 22 Jan 2007 17:10:46 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l0MHAkYh025209;
	Mon, 22 Jan 2007 17:10:46 GMT
	(envelope-from nobody)
Message-Id: <200701221710.l0MHAkYh025209@www.freebsd.org>
Date: Mon, 22 Jan 2007 17:10:46 GMT
From: Yuichiro Goto<y7goto@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bug in fsread in sys/boot/common/ufsread.c
X-Send-Pr-Version: www-3.0

>Number:         108215
>Category:       misc
>Synopsis:       [boot] [patch] bug in fsread in sys/boot/common/ufsread.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kib
>State:          closed
>Quarter:        
>Keywords:       6.x 7.x
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 22 17:20:22 GMT 2007
>Closed-Date:    Fri Oct 17 14:26:07 UTC 2008
>Last-Modified:  Fri Oct 17 14:26:07 UTC 2008
>Originator:     Yuichiro Goto
>Release:        FreeBSD 6.2-RELEASE i386
>Organization:
>Environment:
FreeBSD cobalt.my.domain 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Thu Jan 18 10:10:43 JST 2007     root@cobalt.my.domain:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
Incorrect calculation of a virtual block address within the single indirect block causes corruption of a large file.

>How-To-Repeat:
Read a large file.  On my system, a file that is larger than 16384 * (512 + 12) bytes on a filesystem (UFS2) with bsize = 16384 is corrupted.
>Fix:
See the attached diff.

Patch attached with submission follows:

Index: ufsread.c
===================================================================
RCS file: /home/ncvs/src/sys/boot/common/ufsread.c,v
retrieving revision 1.14
diff -u -r1.14 ufsread.c
--- ufsread.c	30 Jan 2005 14:58:00 -0000	1.14
+++ ufsread.c	22 Jan 2007 16:43:32 -0000
@@ -249,7 +249,7 @@
 		} else if (lbn < NDADDR + NINDIR(fs)) {
 			n = INDIRPERVBLK(fs);
 			addr = DIP(di_ib[0]);
-			u = (u_int)(lbn - NDADDR) / (n * DBPERVBLK);
+			u = (u_int)(lbn - NDADDR) / n * DBPERVBLK;
 			vbaddr = fsbtodb(fs, addr) + u;
 			if (indmap != vbaddr) {
 				if (dskread(indbuf, vbaddr, DBPERVBLK))

>Release-Note:
>Audit-Trail:
also an issue with 7.x?

From: "Volker Theile" <votdev@gmx.de>
To: bug-followup@FreeBSD.org, y7goto@gmail.com
Cc:  
Subject: Re: misc/108215: [boot] [patch] bug in fsread in
 sys/boot/common/ufsread.c
Date: Fri, 06 Jun 2008 13:59:00 +0200

 Hello,
 
 i can confirm that the bug fix solves the reboot problem when using mfsroot images in FreeBSD 6.3. I will test it also on FreeBSD 7.0, but i assume that it will fix it there too.
 Many users using FreeNAS reporting this reboot problem on their machines with RAM > 2GB.
 
 Regards
 Volker (FreeNAS developer && project leader)
 
 -- 
 GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
 Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx
State-Changed-From-To: open->analyzed 
State-Changed-By: linimon 
State-Changed-When: Fri Jun 6 18:01:07 UTC 2008 
State-Changed-Why:  
Volker Theile from the FreeNAS team reports that the patch fixes the problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=108215 
Responsible-Changed-From-To: freebsd-bugs->kib 
Responsible-Changed-By: kib 
Responsible-Changed-When: Fri Jun 6 19:19:19 UTC 2008 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=108215 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/108215: commit references a PR
Date: Sat,  7 Jun 2008 05:42:40 +0000 (UTC)

 kib         2008-06-07 05:42:22 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     sys/boot/common      ufsread.c 
   Log:
   SVN rev 179632 on 2008-06-07 05:42:22Z by kib
   
   Fix the incorrect calculation of a block address within a single indirect
   block.
   
   PR:     108215
   Submitted by:   Yuichiro Goto, y7goto gmail com
   MFC after:      2 weeks
   
   Revision   Changes    Path
   1.14.10.2  +1 -1      src/sys/boot/common/ufsread.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/108215: commit references a PR
Date: Sat,  7 Jun 2008 05:49:40 +0000 (UTC)

 kib         2008-06-07 05:49:24 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/boot/common      ufsread.c 
   Log:
   SVN rev 179634 on 2008-06-07 05:49:24Z by kib
   
   Fix the incorrect calculation of a block address within a single indirect
   block.
   
   PR:     108215
   Submitted by:   Yuichiro Goto, y7goto gmail com
   MFC after:      2 weeks
   
   Revision  Changes    Path
   1.18      +1 -1      src/sys/boot/common/ufsread.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: votdev@gmx.de
To: kib@freebsd.org, bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/108215: [boot] [patch] bug in fsread in
 sys/boot/common/ufsread.c
Date: Mon, 09 Jun 2008 07:21:54 +0200

 Hello,
 
 i did some new tests corresponding this bug and i have to tell you that i was wrong. I'm not able to reproduce anything from friday 06.06. I'm sorry, but can you please revert changes in ufsread.c? I did not want to introduce a new bug with this incorrect BR fix confirmation and loose my credibility, too.
 
 Sorry again for my fast shot.
 
 Regards
 Volker
 
 -- 
 Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
 Ideal fr Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

From: Kostik Belousov <kostikbel@gmail.com>
To: votdev@gmx.de
Cc: bug-followup@freebsd.org
Subject: Re: misc/108215: [boot] [patch] bug in fsread in sys/boot/common/ufsread.c
Date: Mon, 9 Jun 2008 12:19:07 +0300

 --ds9maZbwT7uk2FVi
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On Mon, Jun 09, 2008 at 07:21:54AM +0200, votdev@gmx.de wrote:
 > Hello,
 >=20
 > i did some new tests corresponding this bug and i have to tell you that i=
  was wrong. I'm not able to reproduce anything from friday 06.06. I'm sorry=
 , but can you please revert changes in ufsread.c? I did not want to introdu=
 ce a new bug with this incorrect BR fix confirmation and loose my credibili=
 ty, too.
 >=20
 > Sorry again for my fast shot.
 
 Does it breaks anything for you ?
 
 I had doubts about relevance of the bug and the patch to your problem, and
 you just confirmed my suspection. On the other hand, I analyzed the problem
 and the patch, and I believe that the fix is valid and for a real problem,
 that was introduced in the rev. 1.7 of the ufsread.c. Basically, we did
 the mul by the DBVPERBLK twice.
 
 So, unless the change breaks something for you, I do not see a reason to
 revert it.
 
 --ds9maZbwT7uk2FVi
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.9 (FreeBSD)
 
 iEYEARECAAYFAkhM9YsACgkQC3+MBN1Mb4gMpQCeI3yuzMIylHmZA8q+FXgJzdIl
 XVcAn1s4XjAFA/XR2RE2GW+XfJ6C/wnd
 =Tsc8
 -----END PGP SIGNATURE-----
 
 --ds9maZbwT7uk2FVi--

From: "Volker Theile" <votdev@gmx.de>
To: Kostik Belousov <kostikbel@gmail.com>
Cc: bug-followup@freebsd.org
Subject: Re: misc/108215: [boot] [patch] bug in fsread in
 sys/boot/common/ufsread.c
Date: Mon, 09 Jun 2008 11:44:25 +0200

 Hi,
 
 it does not break anything on my side. So if you can confirm that it is a real problem that will be fixed (as you already did in your mail) i'm OK with that. I only wanted to ensure that the changes are not only done because of my mail.
 
 Regards
 Volker
 
 -------- Original-Nachricht --------
 > Datum: Mon, 9 Jun 2008 12:19:07 +0300
 > Von: Kostik Belousov <kostikbel@gmail.com>
 > An: votdev@gmx.de
 > CC: bug-followup@freebsd.org
 > Betreff: Re: misc/108215: [boot] [patch] bug in fsread in sys/boot/common/ufsread.c
 
 > On Mon, Jun 09, 2008 at 07:21:54AM +0200, votdev@gmx.de wrote:
 > > Hello,
 > > 
 > > i did some new tests corresponding this bug and i have to tell you that
 > i was wrong. I'm not able to reproduce anything from friday 06.06. I'm
 > sorry, but can you please revert changes in ufsread.c? I did not want to
 > introduce a new bug with this incorrect BR fix confirmation and loose my
 > credibility, too.
 > > 
 > > Sorry again for my fast shot.
 > 
 > Does it breaks anything for you ?
 > 
 > I had doubts about relevance of the bug and the patch to your problem, and
 > you just confirmed my suspection. On the other hand, I analyzed the
 > problem
 > and the patch, and I believe that the fix is valid and for a real problem,
 > that was introduced in the rev. 1.7 of the ufsread.c. Basically, we did
 > the mul by the DBVPERBLK twice.
 > 
 > So, unless the change breaks something for you, I do not see a reason to
 > revert it.
 
 -- 
 Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
 Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/108215: commit references a PR
Date: Sat, 21 Jun 2008 08:51:30 +0000 (UTC)

 kib         2008-06-21 08:51:21 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     sys/boot/common      ufsread.c 
   Log:
   SVN rev 179907 on 2008-06-21 08:51:21Z by kib
   
   MFC r179634:
   Fix the incorrect calculation of a block address within a single indirect
   block.
   
   PR:     108215
   
   Revision   Changes    Path
   1.14.10.4  +1 -1      src/sys/boot/common/ufsread.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: analyzed->patched 
State-Changed-By: vwe 
State-Changed-When: Fri Oct 17 14:18:32 UTC 2008 
State-Changed-Why:  

kib, 
this one has been committed and MFC'ed. Can we close this? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=108215 
State-Changed-From-To: patched->closed 
State-Changed-By: kib 
State-Changed-When: Fri Oct 17 14:25:45 UTC 2008 
State-Changed-Why:  
Committed to HEAD and RELENG_7. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=108215 
>Unformatted:
