Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
2ecc6171
Commit
2ecc6171
authored
Feb 12, 2019
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Fix double counting when gc is running
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
39fbc5a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
17 deletions
+6
-17
fs/bcachefs/btree_update_interior.c
fs/bcachefs/btree_update_interior.c
+3
-6
fs/bcachefs/buckets.c
fs/bcachefs/buckets.c
+2
-10
fs/bcachefs/buckets.h
fs/bcachefs/buckets.h
+1
-1
No files found.
fs/bcachefs/btree_update_interior.c
View file @
2ecc6171
...
...
@@ -1088,8 +1088,7 @@ static void bch2_btree_set_root_inmem(struct btree_update *as, struct btree *b)
bch2_btree_node_free_index
(
as
,
NULL
,
bkey_i_to_s_c
(
&
old
->
key
),
fs_usage
);
bch2_fs_usage_apply
(
c
,
fs_usage
,
&
as
->
reserve
->
disk_res
,
gc_pos_btree_root
(
b
->
btree_id
));
bch2_fs_usage_apply
(
c
,
fs_usage
,
&
as
->
reserve
->
disk_res
);
preempt_enable
();
percpu_up_read
(
&
c
->
mark_lock
);
...
...
@@ -1192,8 +1191,7 @@ static void bch2_insert_fixup_btree_ptr(struct btree_update *as, struct btree *b
bkey_disassemble
(
b
,
k
,
&
tmp
),
fs_usage
);
bch2_fs_usage_apply
(
c
,
fs_usage
,
&
as
->
reserve
->
disk_res
,
gc_pos_btree_node
(
b
));
bch2_fs_usage_apply
(
c
,
fs_usage
,
&
as
->
reserve
->
disk_res
);
preempt_enable
();
percpu_up_read
(
&
c
->
mark_lock
);
...
...
@@ -1993,8 +1991,7 @@ static void __bch2_btree_node_update_key(struct bch_fs *c,
bch2_btree_node_free_index
(
as
,
NULL
,
bkey_i_to_s_c
(
&
b
->
key
),
fs_usage
);
bch2_fs_usage_apply
(
c
,
fs_usage
,
&
as
->
reserve
->
disk_res
,
gc_pos_btree_root
(
b
->
btree_id
));
bch2_fs_usage_apply
(
c
,
fs_usage
,
&
as
->
reserve
->
disk_res
);
percpu_up_read
(
&
c
->
mark_lock
);
mutex_unlock
(
&
c
->
btree_interior_update_lock
);
...
...
fs/bcachefs/buckets.c
View file @
2ecc6171
...
...
@@ -255,8 +255,7 @@ static bool bucket_became_unavailable(struct bucket_mark old,
int
bch2_fs_usage_apply
(
struct
bch_fs
*
c
,
struct
bch_fs_usage
*
fs_usage
,
struct
disk_reservation
*
disk_res
,
struct
gc_pos
gc_pos
)
struct
disk_reservation
*
disk_res
)
{
s64
added
=
fs_usage
->
s
.
data
+
fs_usage
->
s
.
reserved
;
s64
should_not_have_added
;
...
...
@@ -285,13 +284,6 @@ int bch2_fs_usage_apply(struct bch_fs *c,
acc_u64s
((
u64
*
)
this_cpu_ptr
(
c
->
usage
[
0
]),
(
u64
*
)
fs_usage
,
sizeof
(
*
fs_usage
)
/
sizeof
(
u64
)
+
c
->
replicas
.
nr
);
if
(
gc_visited
(
c
,
gc_pos
))
{
BUG_ON
(
!
c
->
usage
[
1
]);
acc_u64s
((
u64
*
)
this_cpu_ptr
(
c
->
usage
[
1
]),
(
u64
*
)
fs_usage
,
sizeof
(
*
fs_usage
)
/
sizeof
(
u64
)
+
c
->
replicas
.
nr
);
}
preempt_enable
();
return
ret
;
...
...
@@ -1001,7 +993,7 @@ void bch2_mark_update(struct btree_insert *trans,
bch2_btree_node_iter_advance
(
&
node_iter
,
b
);
}
if
(
bch2_fs_usage_apply
(
c
,
fs_usage
,
trans
->
disk_res
,
pos
)
&&
if
(
bch2_fs_usage_apply
(
c
,
fs_usage
,
trans
->
disk_res
)
&&
!
warned_disk_usage
&&
!
xchg
(
&
warned_disk_usage
,
1
))
{
char
buf
[
200
];
...
...
fs/bcachefs/buckets.h
View file @
2ecc6171
...
...
@@ -260,7 +260,7 @@ int bch2_mark_key(struct bch_fs *, struct bkey_s_c,
struct
bch_fs_usage
*
,
u64
,
unsigned
);
void
bch2_mark_update
(
struct
btree_insert
*
,
struct
btree_insert_entry
*
);
int
bch2_fs_usage_apply
(
struct
bch_fs
*
,
struct
bch_fs_usage
*
,
struct
disk_reservation
*
,
struct
gc_pos
);
struct
disk_reservation
*
);
/* disk reservations: */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment