From owner-freebsd-questions@FreeBSD.ORG Tue Sep 25 14:08:54 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C53CF16A419 for ; Tue, 25 Sep 2007 14:08:54 +0000 (UTC) (envelope-from tedm@toybox.placo.com) Received: from mail.freebsd-corp-net-guide.com (mail.freebsd-corp-net-guide.com [65.75.192.90]) by mx1.freebsd.org (Postfix) with ESMTP id 6A42313C44B for ; Tue, 25 Sep 2007 14:08:54 +0000 (UTC) (envelope-from tedm@toybox.placo.com) Received: from TEDSDESK (nat-rtr.freebsd-corp-net-guide.com [65.75.197.130]) by mail.freebsd-corp-net-guide.com (8.13.8/8.13.8) with SMTP id l8PE8boZ060412; Tue, 25 Sep 2007 07:08:46 -0700 (PDT) (envelope-from tedm@toybox.placo.com) From: "Ted Mittelstaedt" To: "Erik Trulsson" Date: Tue, 25 Sep 2007 07:09:16 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <20070925122718.GA96576@owl.midgard.homeip.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896 Importance: Normal Cc: Chris Boyd , freebsd-questions@freebsd.org, Bart Silverstrim Subject: RE: Update on data corruption with Tyan/3Ware X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Sep 2007 14:08:54 -0000 > -----Original Message----- > From: Erik Trulsson [mailto:ertr1013@student.uu.se] > Sent: Tuesday, September 25, 2007 5:27 AM > To: Ted Mittelstaedt > Cc: Bart Silverstrim; Chris Boyd; freebsd-questions@freebsd.org > Subject: Re: Update on data corruption with Tyan/3Ware > > > Bart and Chris, > > > > The problem might be that the 3ware driver uses a 32 bit "int" to > > represent > > a file size. > > The 3ware driver handles blocks on the device. It knows nothing > about files or their sizes. That is the job of the filesystem > which resides > at a higher level in the OS. > > It is true that the 3ware twe(4) driver uses 32-bit ints to represent the > *disk* size in number of disk-blocks. With the standard 512-byte > block size > this gives a maximum disk size of (512*4G==) 2TB, which is a known > limitation of the twe(4) driver as well as many other disk controllers. > Anyways the twa(4) driver is supposed to handle volumes larger than 2TB. > > (twe(4) handles 3ware 7000 and 8000-series controllers, while the twa(4) > driver is for the 9000-series.) > Your right, I missed that. > > In FreeBSD, stat() ftruncate() lseek() and > > friends which are based on "strut stat" had this limitation > under FreeBSD > > 4.xx. > > > > Note line# 821 of twe_freebsd.c the driver: > > > > sc->twed_disk->d_maxsize = (TWE_MAX_SGL_LENGTH - 1) * PAGE_SIZE; > > sc->twed_disk->d_sectorsize = TWE_BLOCK_SIZE; > > sc->twed_disk->d_mediasize = TWE_BLOCK_SIZE * > > (off_t)sc->twed_drive->td_size; > > sc->twed_disk->d_fwsectors = sc->twed_drive->td_sectors; > > > > that off_t also appears elsewhere. > > Since off_t is a 64-bit type, and since none of that code fragment has > anything to do with *file* sizes, I am not sure what your point is. > This isn't true, it is OS dependent. On FreeBSD 64 bit it may be a long long but it isn't on all UNIXes. (particularly old ones) That is why GNU/Linux has (or had) off64_t It's my understanding the twa/twe drivers have a binary "blob" that they loads. You don't know what architecture this blob was compiled under. I merely pointed out use of this code fragment to illustrate a point, not to state that this was a bug in the driver to indicate that it may be possible the blob as a limitation of some kind. Since Bart Silverstrim says he is storing >4GB files without trouble under Linux, I would ASSUME the limitation ISN'T in the 3ware hardware. Apparently you missed the post from Chris that states: "...FreeBSD 6.2 AMD64 with all patches as of 9-21-2007..." "...We've narrowed the problem down to files that are > 4GB. Anytime we have a file that's > 4GB, we get inconsistent checksums, can't uncompress it, etc. Files < 4GB are fine..." So as I already stated the VERY FIRST RESPONSE that Chris needs to go to 3ware and ask them what is going on. Unless your going to continue to say that FreeBSD64 has a 4GB filesize limitation? Ted