Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FUSE component breaks git (cannot pread pack file: Bad file descriptor) #11

Closed
chewi opened this issue Oct 15, 2017 · 3 comments
Closed

Comments

@chewi
Copy link

chewi commented Oct 15, 2017

I've hit one or two problems, mainly in php-sync and I'll push those fixes up later, but first I've encountered what I consider to be a showstopper.

$ git fetch
remote: Counting objects: 116, done.
remote: Compressing objects: 100% (116/116), done.
remote: Total 116 (delta 97), reused 0 (delta 0)
Receiving objects: 100% (116/116), 22.44 KiB | 0 bytes/s, done.
fatal: cannot pread pack file: Bad file descriptor
fatal: index-pack failed

The same operation works fine on the underlying filesystem. I've tried twiddling various FUSE options but none seem to make any difference. I'm using FUSE 2.9.7 on Gentoo. I've noticed that there are some operations that you have not implemented but none seem to relate to pread.

@chewi
Copy link
Author

chewi commented Oct 17, 2017

I wondered whether this was a wider FUSE problem so I built their fusexmp_fh example, which is quite similar to SFS, and that worked fine.

@lucabrunox
Copy link
Collaborator

I chewi, SFS is not meant to hold Git repositories, especially because I'm not sure the PHP handles hard links correctly. It's supposed to work with simple files, write them and get them replicated.

However, that pread() failure might also be related to special flags during open(). Not sure how git opened the files there.

@chewi
Copy link
Author

chewi commented Oct 18, 2017

Thanks, your suggestion helped me to figure it out. I had been comparing SFS and fusexmp_fh but hadn't noticed the difference in the way files are created until now.

SFS:

fd = creat(fpath, mode);

fusexmp_fh:

fd = open(path, fi->flags, mode);

The latter works. I will include this in a pull request soon.

There are a number of other small differences between SFS and fusexmp_fh for which I can see no obvious reason. For example, fusexmp_fh also handles pipes (mkfifo) in the mknod handler and it uses lchown rather than chown in the chown handler. Perhaps we should follow fusexmp_fh more closely. What do you think?

I can appreciate that SFS wasn't designed to handle git repositories but I have come here after trying GlusterFS (too slow), OriFS (unmaintained, poorly documented, didn't work, very unstable), and MooseFS (unsuitable for 2 nodes). I am rather desperate at this point. It would only be me working on these files so I do not expect both sides to be modified at the same time.

I am aware that git uses hard links so I did grab @mokraemer's fix for hard links but haven't vet verified whether this works.

@chewi chewi closed this as completed Oct 18, 2017
chewi added a commit to chewi/sfs that referenced this issue Oct 18, 2017
This allows additional flags to be passed, which fixes git.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants