Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
redoxfs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Kröning
redoxfs
Commits
dcba5d80
Unverified
Commit
dcba5d80
authored
11 months ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
0.6.3: Fix CoW of records dropping data
parent
7dc8323d
Branches
master
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Cargo.lock
+7
-7
7 additions, 7 deletions
Cargo.lock
Cargo.toml
+1
-1
1 addition, 1 deletion
Cargo.toml
src/transaction.rs
+5
-3
5 additions, 3 deletions
src/transaction.rs
with
13 additions
and
11 deletions
Cargo.lock
+
7
−
7
View file @
dcba5d80
...
@@ -232,9 +232,9 @@ checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
...
@@ -232,9 +232,9 @@ checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
[[package]]
[[package]]
name = "memchr"
name = "memchr"
version = "2.7.
1
"
version = "2.7.
2
"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149
"
checksum = "
6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d
"
[[package]]
[[package]]
name = "numtoa"
name = "numtoa"
...
@@ -326,7 +326,7 @@ checksum = "20145670ba436b55d91fc92d25e71160fbfbdd57831631c8d7d36377a476f1cb"
...
@@ -326,7 +326,7 @@ checksum = "20145670ba436b55d91fc92d25e71160fbfbdd57831631c8d7d36377a476f1cb"
[[package]]
[[package]]
name = "redoxfs"
name = "redoxfs"
version = "0.6.
2
"
version = "0.6.
3
"
dependencies = [
dependencies = [
"aes",
"aes",
"argon2",
"argon2",
...
@@ -372,9 +372,9 @@ dependencies = [
...
@@ -372,9 +372,9 @@ dependencies = [
[[package]]
[[package]]
name = "regex-syntax"
name = "regex-syntax"
version = "0.8.
2
"
version = "0.8.
3
"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f
"
checksum = "
adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56
"
[[package]]
[[package]]
name = "seahash"
name = "seahash"
...
@@ -396,9 +396,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
...
@@ -396,9 +396,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
[[package]]
[[package]]
name = "syn"
name = "syn"
version = "2.0.5
3
"
version = "2.0.5
7
"
source = "registry+https://github.com/rust-lang/crates.io-index"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
7383cd0e49fff4b6
b9
0
ca
5670bfd3e9d6a733b3f90c686605aa7eec8c4996032
"
checksum = "
11a6ae1e52eb25aab8f3f
b9
f
ca
13be982a373b8f1157ca14b897a825ba4a2d35
"
dependencies = [
dependencies = [
"proc-macro2",
"proc-macro2",
"quote",
"quote",
...
...
This diff is collapsed.
Click to expand it.
Cargo.toml
+
1
−
1
View file @
dcba5d80
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
name
=
"redoxfs"
name
=
"redoxfs"
description
=
"The Redox Filesystem"
description
=
"The Redox Filesystem"
repository
=
"https://gitlab.redox-os.org/redox-os/redoxfs"
repository
=
"https://gitlab.redox-os.org/redox-os/redoxfs"
version
=
"0.6.
2
"
version
=
"0.6.
3
"
license-file
=
"LICENSE"
license-file
=
"LICENSE"
readme
=
"README.md"
readme
=
"README.md"
authors
=
[
"Jeremy Soller <jackpot51@gmail.com>"
]
authors
=
[
"Jeremy Soller <jackpot51@gmail.com>"
]
...
...
This diff is collapsed.
Click to expand it.
src/transaction.rs
+
5
−
3
View file @
dcba5d80
...
@@ -309,11 +309,12 @@ impl<'a, D: Disk> Transaction<'a, D> {
...
@@ -309,11 +309,12 @@ impl<'a, D: Disk> Transaction<'a, D> {
level
:
BlockLevel
,
level
:
BlockLevel
,
)
->
Result
<
BlockData
<
T
>>
{
)
->
Result
<
BlockData
<
T
>>
{
let
record
=
unsafe
{
self
.read_block_or_empty
(
ptr
)
?
};
let
record
=
unsafe
{
self
.read_block_or_empty
(
ptr
)
?
};
if
record
.addr
()
.level
()
==
level
{
if
record
.addr
()
.level
()
>=
level
{
// Return record if it is larger than or equal to requested level
return
Ok
(
record
);
return
Ok
(
record
);
}
}
//
Resize
record if
need
ed
//
Expand
record if
larger level request
ed
let
(
_old_addr
,
old_raw
)
=
unsafe
{
record
.into_parts
()
};
let
(
_old_addr
,
old_raw
)
=
unsafe
{
record
.into_parts
()
};
let
mut
raw
=
match
T
::
empty
(
level
)
{
let
mut
raw
=
match
T
::
empty
(
level
)
{
Some
(
empty
)
=>
empty
,
Some
(
empty
)
=>
empty
,
...
@@ -1121,7 +1122,8 @@ impl<'a, D: Disk> Transaction<'a, D> {
...
@@ -1121,7 +1122,8 @@ impl<'a, D: Disk> Transaction<'a, D> {
if
buf
[
i
..
i
+
len
]
!=
record
.data
()[
j
..
j
+
len
]
{
if
buf
[
i
..
i
+
len
]
!=
record
.data
()[
j
..
j
+
len
]
{
unsafe
{
unsafe
{
let
mut
old_addr
=
record
.swap_addr
(
self
.allocate
(
level
)
?
);
// CoW record using its current level
let
mut
old_addr
=
record
.swap_addr
(
self
.allocate
(
record
.addr
()
.level
())
?
);
// If the record was resized we need to dealloc the original ptr
// If the record was resized we need to dealloc the original ptr
if
old_addr
.is_null
()
{
if
old_addr
.is_null
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment