Date: Fri, 06 Jul 2007 01:10:37 -0400 From: Joe Marcus Clarke <marcus@marcuscom.com> To: Brian Donnell <bdonnell@gmail.com> Cc: current <current@freebsd.org>, "Boris S." <bst2006@dva.dyndns.org>, Pascal Hofstee <caelian@gmail.com> Subject: Re: ZFS vs Samba Debugging Results ... Need Help. Message-ID: <1183698637.55166.58.camel@shumai.marcuscom.com> In-Reply-To: <1c5c32890707051739t6621e2d4ude73ce5d096ea72e@mail.gmail.com> References: <d8a0b7620707031331w5b0fcae2jd96cb7ff8b3f34d6@mail.gmail.com> <d8a0b7620707031359wc178fdfocf2387820fcacbf5@mail.gmail.com> <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>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-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 <caelian@gmail.com> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1183698637.55166.58.camel>