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

[WIP] MFS improvements #4517

Closed
wants to merge 7 commits into from
Closed

[WIP] MFS improvements #4517

wants to merge 7 commits into from

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien commented Dec 21, 2017

  • Avoid syncing/flushing after closing an fd.
  • Avoid reading/writing after closing an fd.
  • Use a rw lock to guard the file's node (allows concurrent size checks).
  • Improve flags and mode. Make file open options an extensible struct. Unix uses an int because it's easier to pass in a syscall and it has a fixed size. We don't care about that.
  • Fix MFS: Race when reading node and taking read/write lock #4514 (take the read/write lock before reading the file's node).
  • Avoid syncing/flushing when we don't need to.

@ghost ghost assigned Stebalien Dec 21, 2017
@ghost ghost added the status/in-progress In progress label Dec 21, 2017
* Ensure we don't flush unnecessarily.
* Make it easier to work with modes/flags.
* Better handle closed files.

License: MIT
Signed-off-by: Steven Allen <[email protected]>
Otherwise, it could be exchanged out from under us!

fixes #4514

License: MIT
Signed-off-by: Steven Allen <[email protected]>
This allows us to, e.g., get the size, etc. in parallel.

License: MIT
Signed-off-by: Steven Allen <[email protected]>
Technically, the sync could fail. If it does, we don't want to allow
syncing *again* without the write lock held.

License: MIT
Signed-off-by: Steven Allen <[email protected]>
@Stebalien Stebalien changed the title MFS improvements [WIP] MFS improvements Dec 21, 2017
fixes #4518

License: MIT
Signed-off-by: Steven Allen <[email protected]>
tests #4519

License: MIT
Signed-off-by: Steven Allen <[email protected]>
(hint: it fails)

License: MIT
Signed-off-by: Steven Allen <[email protected]>
@schomatis
Copy link
Contributor

This code has been moved to go-mfs, what can be extracted from this PR will be continued in ipfs/go-mfs#32.

@schomatis schomatis closed this Dec 13, 2018
@ghost ghost removed the status/in-progress In progress label Dec 13, 2018
nitishm pushed a commit to nitishm/go-mfs that referenced this pull request Dec 25, 2018
Pulled changes from ipfs/kubo#4517, on top of, ipfs#45.
Change added to unblock the `waitPub()` call. With the elimination of
stateSync cause a `updateChildEntry` to happen for `stateFlushed` as
well, causing it to propogate upwards to the parent(s) [fullSync] and
force a publish to happen, hence unblocking `waitPub`.
nitishm pushed a commit to nitishm/go-mfs that referenced this pull request Dec 30, 2018
Pulled changes from ipfs/kubo#4517, on top of, ipfs#45.
Change added to unblock the `waitPub()` call. With the elimination of
stateSync cause a `updateChildEntry` to happen for `stateFlushed` as
well, causing it to propogate upwards to the parent(s) [fullSync] and
force a publish to happen, hence unblocking `waitPub`.
@Stebalien Stebalien deleted the feat/improve-mfs branch February 28, 2019 22:01
@Stebalien Stebalien restored the feat/improve-mfs branch May 30, 2019 22:33
@Stebalien Stebalien deleted the feat/improve-mfs branch May 30, 2019 22:34
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

Successfully merging this pull request may close these issues.

MFS: Race when reading node and taking read/write lock
2 participants