Giter Site home page Giter Site logo

"Level 2 not synchronized" about tabfs HOT 6 OPEN

eichin avatar eichin commented on August 16, 2024
"Level 2 not synchronized"

from tabfs.

Comments (6)

osnr avatar osnr commented on August 16, 2024

Huh. I don't have any ideas off the top of my head, but I should look into this more. Could you make a Web page of your own with a leading dot and see if that also breaks it?

from tabfs.

eichin avatar eichin commented on August 16, 2024

Good idea. I created /tmp/test.html containing

<html>
  <head>
    <title>.:: test ::.</title>
  </head>
</html>

and open file:///tmp/test.html and now get

  /usr/bin/ls: cannot access '/home/eichin/gits/TabFS/fs/mnt/tabs/by-title/.___test____.4445': Level 2 not synchronized
    ?????????? ? ?    ?     ?            ? .___test____.4445

If I strip it down to .: it still fails; . by itself works as does .x.

from tabfs.

eichin avatar eichin commented on August 16, 2024

(if it matters this is Google Chrome 102.0.5005.115 (Official Build) (64-bit) as I see I didn't include that in the initial post.)

from tabfs.

eichin avatar eichin commented on August 16, 2024

strace confirms that the ls is getting an EL2NSYNC, but I don't find reference to that in the fuse sources, or really anywhere but fairly obscure places in the kernel.

97267 statx(AT_FDCWD</home/eichin/tmp/deb>, "/home/eichin/gits/TabFS/fs/mnt/tabs/by-title/._.4445", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_MODE|STATX_NLINK|STATX_UID|STATX_GID|STATX_MTIME|STATX_SIZE, 0x7ffec4298820) = -1 EL2NSYNC (Level 2 not synchronized)

(That does suggest the kernel matters, so uname -r output for reference: 5.15.0-23-generic )

from tabfs.

eichin avatar eichin commented on August 16, 2024

Ah! Recalling that errno values are really just numbers... for x86_64 linux, EL2NSYNC is 45. Looking at extension/background.js, though,

const unix = {
...
  ENOTSUP: 45,
...

so that's probably the value that's making it through.

The only reference to that is

function tryMatchRoute(path) {
  if (path.match(/\/\._[^\/]+$/)) {
    // Apple Double ._whatever file for xattrs
    throw new UnixError(unix.ENOTSUP); 
  }

which... is definitely suspicious :-)

from tabfs.

eichin avatar eichin commented on August 16, 2024

So there are two issues here. The easier one would be that the AppleDouble filtering matches some sanitized paths, that probably just means tweaking sanitize a little.

The trickier one is that errno is platform specific in a way that JavaScript intentionally conceals. If I'm reading this right, the path is that in background.js, onMessage has a try/catch, and if it catches a UnixError puts the error value in response.error. From there, tabfs.c do_exchange looks for {error: %d} with json_scanf and grabs that number.

Suggestion: tabfs.c knows what platform it's on (has a couple of #if defined but more importantly, already includes <errno.h>.) Put a translation there; you could make the unix enumeration in background.js just have a list of values... but I'd go with just having it return text tokens outright - then tabfs can check for strings and return the proper platform-specific errno values. Not a lot of overhead (you're passing JSON messages around anyway) though it is a change in the protocol; if that's a concern, then taking the current numbers and translating them makes more sense.

from tabfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.