From owner-freebsd-current@FreeBSD.ORG Fri Jul 6 05:10:47 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 899CD16A41F for ; Fri, 6 Jul 2007 05:10:47 +0000 (UTC) (envelope-from marcus@marcuscom.com) Received: from creme-brulee.marcuscom.com (creme-brulee.marcuscom.com [24.172.16.118]) by mx1.freebsd.org (Postfix) with ESMTP id 38DE713C457 for ; Fri, 6 Jul 2007 05:10:47 +0000 (UTC) (envelope-from marcus@marcuscom.com) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.1/8.14.1) with ESMTP id l665B2tr093899; Fri, 6 Jul 2007 01:11:02 -0400 (EDT) (envelope-from marcus@marcuscom.com) From: Joe Marcus Clarke To: Brian Donnell In-Reply-To: <1c5c32890707051739t6621e2d4ude73ce5d096ea72e@mail.gmail.com> References: <46633B27.50601@dva.dyndns.org> <1c5c32890707031732s195a97c3vd29fb46323f28fae@mail.gmail.com> <46644820.6020609@dva.dyndns.org> <1c5c32890707041057x75712a20vef9800a7ddef7a6a@mail.gmail.com> <1183674495.75595.14.camel@worf> <1c5c32890707051739t6621e2d4ude73ce5d096ea72e@mail.gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-O2niRc7jgPx4QnLc4u5n" Organization: MarcusCom, Inc. Date: Fri, 06 Jul 2007 01:10:37 -0400 Message-Id: <1183698637.55166.58.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=no version=3.2.0 X-Spam-Checker-Version: SpamAssassin 3.2.0 (2007-05-01) on creme-brulee.marcuscom.com Cc: current , "Boris S." , Pascal Hofstee Subject: Re: ZFS vs Samba Debugging Results ... Need Help. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jul 2007 05:10:47 -0000 --=-O2niRc7jgPx4QnLc4u5n Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, 2007-07-05 at 20:39 -0400, Brian Donnell wrote: > Thanks to Pascal Hofstee and Joe Marcus Clarke I found a way to get ZFS > samba shared. I haven't run into any problems yet, but consider it > experimental. You're going to love how simple this one was. >=20 > cd /usr/ports/net/samba3 > make patch > cd work/samba-3.0.25a/source/lib/replace > rm repdir_get* > cd /usr/ports/net/samba3 > make install Yes, this "works" as Pascal tested for me earlier. However, if you read the comments in this file there was a reason these functions are overridden. The way that telldir() works can cause issues when closedir() is called (e.g. network timeouts). In any event, I'm not sure there's a better way to do this when it comes to ZFS. When doing an lseek() on a ZFS directory, the internal offset is set to a hash code value (as far as I can tell). You can not reliably increment this by some number, and get back to the same location in a given directory (in fact, you can easily get a segfault by doing that). Joe >=20 > And now it works. Just get rid of the offending functions. I've had no > problems reading or writing files of large and small size in directories > with only a couple files or a couple hundred. It was so simple it makes = me > think something is still very wrong. But I'm having no problems now. >=20 > -- Brian >=20 > On 7/5/07, Pascal Hofstee wrote: > > > > Hi, > > > > I did some addititional debugging and adding a small workaround to > > smbd/vfs.c making the function vfs_readdirname() return ptr->d_name > > directly instead of relying on the temporary variable dname gets the > > code properly skipping the "." and ".." entries. > > > > >From that point on the code enters into a new problem area which can b= e > > observed in the backtrace posted at http://pastebin.ca/604961 > > > > Joe Marcus Clarke helped me out further with debugging this problem and > > we have come to the conclusion that the following assertion in samba's > > telldir() implementation located in lib/replace/repdir_getdirentries.c > > does not hold true on ZFS directories (marcus mentioned something about > > lseek() behaving differently on ZFS than it does on UFS): > > > > if (d->seekpos & (DIR_BUF_SIZE-1)) { > > abort(); > > } > > > > Marcus was so kind to put up a simple test case at > > http://www.marcuscom.com/downloads/samba_zfs.c > > > > Change main() to point to a ZFS directory, and watch it crash. > > Then point to a UFS directory, and it works. > > The seekpos is printed each time. > > > > Hopefully this will be enough information to get us to figure out a > > workable solution here. > > > > -- > > Pascal Hofstee > > > > > > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org= " >=20 --=20 PGP Key : http://www.marcuscom.com/pgp.asc --=-O2niRc7jgPx4QnLc4u5n Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQBGjc7Lb2iPiv4Uz4cRAqZeAKCf0gnizMSJdO4iXyojTEx/za4aGACglT2d HtZ3V+cZo/oN/XlyG//t5EA= =IyuP -----END PGP SIGNATURE----- --=-O2niRc7jgPx4QnLc4u5n--