Subject: Re: Error -50 copying from OS X

From: [email-masked]
Date: Fri, 21 Dec 2001 12:52:17 +0000

Trying to do this on linux redhat 7.1, I get

bash-2.04$ patch -p0 <directory.h.patch
patch unexpectedly ends in middle of line
patch: **** Only garbage was found in the patch input.

At 20/12/2001 20:54:44, Steve Freitas <[email-masked]> wrote:
#  Rick,
#
#  Joe Clarke has heard your pain! See below:
#
#  ----------
#  From: Joe Clarke <[email-masked]>
#  Date: Thu, 20 Dec 2001 12:33:00 -0500 (EST)
#  To: Steve Freitas <[email-masked]>
#  Subject: Re: FW: Error -50 copying from OS X
#
#  Give these patches a try.  This implements a hashdid/lastdid hybrid.
#  You're free to give these out to others, but know that it may cause data
#  loss.  Hopefully, it will fix the -50 errors while not causing data loss.
#  Please provide feedback as soon as you can.
#
#  Joe
#  ----------
#
#  The patches should apply against RC2. Grab it, untar it, then put the
#  patches into <netatalk RC2 source dir>/etc/afpd. Then cd to etc/afpd and
#  apply them:
#
#  patch -p0 < directory.h.patch
#  patch -p0 < file.c.patch
#  patch -p0 < enumerate.c.patch
#
#  Then configure, use --with-did=last, make, make install and give it a try.
#
#  Steve
#
#
#   - directory.h.patch - file.c.patch - enumerate.c.patch
Roger

---

From: Rick Zeman <[email-masked]>
Date: Fri, 21 Dec 2001 11:08:39 -0500

> #  Joe Clarke has heard your pain! See below:

Yah, that was because somehow (Steve's OE?) the text files got converted to
Mac line endings.  Change the files to Unix endings (I used BBEdit) and
they'll then work.

-- 
"So Long, and Thanks For All the Fish."
       --Douglas Adams
          1952-2001

---

From: Joe Clarke <[email-masked]>
Date: Fri, 21 Dec 2001 11:02:28 -0500 (EST)

Attached are the actual files instead of patches.  Please place them in
etc/afpd, and recompile.  They may come through uuencoded, so please make
sure they're C source code before trying to compile them.

Joe

---

From: Joe Clarke <[email-masked]>
Date: 22 Dec 2001 16:35:02 -0500

Has anyone tried these patches yet?  I'm curious to know if the -50
errors have gone away.

Joe

---

From: Rick Zeman <[email-masked]>
Date: Sat, 22 Dec 2001 16:45:19 -0500

> Has anyone tried these patches yet?  I'm curious to know if the -50

I have tried them and I've yet to get the -50 with did=last and NO flocks.

---

From: Joe Clarke <[email-masked]>
Date: 22 Dec 2001 18:53:47 -0500

> I have tried them and I've yet to get the -50 with did=last and NO flocks.

Cool.  If all goes well, I may merge in the changes so to make the
release.  Tell me, are you seeing any DID conflict messages in your
syslog?

Joe

---

From: Rick Zeman <[email-masked]>
Date: Sat, 22 Dec 2001 23:01:09 -0500

> release.  Tell me, are you seeing any DID conflict messages in your

None.

---

From: Rick Zeman <[email-masked]>
Date: Sun, 23 Dec 2001 17:45:08 -0500

> release.  Tell me, are you seeing any DID conflict messages in your

Nope, but I have been seeing a bunch of these, especially when running a cd
image through a loop device forked through netatalk:

Dec 23 17:25:48 rzeman afpd[779]: flushfork: dfile(3) Invalid argument
Dec 23 17:25:48 rzeman afpd[779]: afp_flushfork: Invalid argument
Dec 23 17:27:10 rzeman afpd[779]: flushfork: dfile(4) Invalid argument
Dec 23 17:27:10 rzeman afpd[779]: afp_flushfork: Invalid argument
Dec 23 17:28:14 rzeman afpd[779]: flushfork: dfile(3) Invalid argument
Dec 23 17:28:14 rzeman afpd[779]: afp_flushfork: Invalid argument
Dec 23 17:28:41 rzeman afpd[779]: flushfork: dfile(6) Invalid argument
Dec 23 17:28:41 rzeman afpd[779]: afp_flushfork: Invalid argument
Dec 23 17:29:15 rzeman afpd[779]: flushfork: dfile(5) Invalid argument
Dec 23 17:29:15 rzeman afpd[779]: afp_flushfork: Invalid argument

---

From: Joe Clarke <[email-masked]>
Date: 23 Dec 2001 18:19:03 -0500

> image through a loop device forked through netatalk:

This happens if the open AppleDouble data fork file descriptor specifies
a socket or other special file that doesn't support synchronization. 
I'm not exactly sure what you're doing, but it looks like the filesystem
or the files being opened do not support the fsync(2) call.

Joe

---

From: Rick Zeman <[email-masked]>
Date: Sun, 23 Dec 2001 22:16:31 -0500

On 12/23/01 5:45 PM, "Rick Zeman" <[email-masked]> wrote:

> Nope

I lied big-time.  I have a mount point (/mac) that's purely Mac files (~4500
files, 1.4 GB).  When I first compiled rc2, I recreated all of the files
(it's a mirror of another server).  This was with did=hash.  All worked
fine, but was told it wasn't safe.  Recompiled with the patches and
configured did=last.  Still worked well, adding and subtracting small
amounts of files.

Recreated the contents of /mac from scratch and all hell broke
loose....HUNDREDS of DID errors...and a totally confused file structure.
Recompiled with did=hash (if I do this any more, I'm going to have to have
separate compile directories) and the 1.4 GB went back into /mac without an
error.

Something tells me that did=last with the patches freaks when coping
thousands of files or a large amount on disk.

---

From: Joe Clarke <[email-masked]>
Date: 23 Dec 2001 23:04:30 -0500

> separate compile directories) and the 1.4 GB went back into /mac without an

That's strange.  I copied my Mac OS X System folder to a Netatalk volume
(26000 files) under OS 9.2.2, and it went off without a hitch.

Can you send me a copy of the directory.h you're using?  Also, did you
get any Finder errors (-50, -43, etc.)?  What Mac OS did you use to do
the copies.

Also, if you can reproduce the problem, I have a Perl script I'd like
you to run to help me track things down.

Joe