rschroll / rmfuse

FUSE access to the reMarkable Cloud
MIT License
95 stars 8 forks source link

Failure to upload large files on MacOS #18

Open rschroll opened 3 years ago

rschroll commented 3 years ago

This is continuing the discussion in #2.

There, it was discovered that large files were not being uploaded correctly on MacOS. It appears that the beginning of the file was full of \x00 bytes. This kept us from figuring out the file type, but presumably this would also cause the file as uploaded to be broken. The same files that cause this problem work fine on a Linux system, so it's something specific to the Mac, it seems.

A couple of possibilities:

  1. MacOS is writing the file full of null bytes first. Not sure why it would do this, nor why it only does this for large files.
  2. Something is going wrong in llfuse, which is being used for MacOS. But I can't reproduce it with llfuse on Linux.
  3. Something is going wrong in MacFuse.
rschroll commented 3 years ago

A bit of a shot in the dark, but if you're willing to try something, @AaronDavidSchneider:

Let's try setting stats.f_bsize = stats.f_frsize = 0 here: https://github.com/rschroll/rmfuse/blob/master/rmfuse/fuse.py#L486. Another filesystem I saw specifically set these to zero for Macs, although I couldn't make out why. We'll also have to adjust the next line to avoid a divide-by-zero error. The right-hand side change be changed from 2**32 / stats.f_frsize to 2**32 / 4096, or any other large number, presumably.

I'm not too hopeful that this solves the problem, but I haven't had any better ideas, I'm afraid.

AaronDavidSchneider commented 3 years ago

Hi, I just tried it. Unfortunately nothing changed. Large files (like the flight plan still do not work)

rschroll commented 3 years ago

Thanks for trying, anyway. At this point, I may need to reach out to the MacFUSE people to see if they have any ideas. I'll tag you when I do, if that's okay with you.

On Mon, Mar 15, 2021 at 12:12 AM Aaron David Schneider < @.***> wrote:

Hi, I just tried it. Unfortunately nothing changed. Large files (like the flight plan still do not work)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rschroll/rmfuse/issues/18#issuecomment-799174745, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACZ2HZEZ7ZDSZ4YOMOPAGDTDWXN7ANCNFSM4YYFU3EQ .

nils-werner commented 2 years ago

I am really curious about this bug... Did you ask the FUSE devs? Do you have a link to that discussion?