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
bf0c55c9
Commit
bf0c55c9
authored
Jul 11, 2014
by
Slava Pestov
Committed by
Kent Overstreet
Aug 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcache: fix crash with incomplete cache set
Change-Id: I6abde52afe917633480caaf4e2518f42a816d886
parent
d83353b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
drivers/md/bcache/bcache.h
drivers/md/bcache/bcache.h
+4
-0
drivers/md/bcache/super.c
drivers/md/bcache/super.c
+4
-0
No files found.
drivers/md/bcache/bcache.h
View file @
bf0c55c9
...
@@ -477,9 +477,13 @@ struct gc_stat {
...
@@ -477,9 +477,13 @@ struct gc_stat {
* CACHE_SET_STOPPING always gets set first when we're closing down a cache set;
* CACHE_SET_STOPPING always gets set first when we're closing down a cache set;
* we'll continue to run normally for awhile with CACHE_SET_STOPPING set (i.e.
* we'll continue to run normally for awhile with CACHE_SET_STOPPING set (i.e.
* flushing dirty data).
* flushing dirty data).
*
* CACHE_SET_RUNNING means all cache devices have been registered and journal
* replay is complete.
*/
*/
#define CACHE_SET_UNREGISTERING 0
#define CACHE_SET_UNREGISTERING 0
#define CACHE_SET_STOPPING 1
#define CACHE_SET_STOPPING 1
#define CACHE_SET_RUNNING 2
struct
cache_set
{
struct
cache_set
{
struct
closure
cl
;
struct
closure
cl
;
...
...
drivers/md/bcache/super.c
View file @
bf0c55c9
...
@@ -1284,6 +1284,9 @@ int bch_flash_dev_create(struct cache_set *c, uint64_t size)
...
@@ -1284,6 +1284,9 @@ int bch_flash_dev_create(struct cache_set *c, uint64_t size)
if
(
test_bit
(
CACHE_SET_STOPPING
,
&
c
->
flags
))
if
(
test_bit
(
CACHE_SET_STOPPING
,
&
c
->
flags
))
return
-
EINTR
;
return
-
EINTR
;
if
(
!
test_bit
(
CACHE_SET_RUNNING
,
&
c
->
flags
))
return
-
EPERM
;
u
=
uuid_find_empty
(
c
);
u
=
uuid_find_empty
(
c
);
if
(
!
u
)
{
if
(
!
u
)
{
pr_err
(
"Can't create volume, no room for UUID"
);
pr_err
(
"Can't create volume, no room for UUID"
);
...
@@ -1706,6 +1709,7 @@ static void run_cache_set(struct cache_set *c)
...
@@ -1706,6 +1709,7 @@ static void run_cache_set(struct cache_set *c)
flash_devs_run
(
c
);
flash_devs_run
(
c
);
set_bit
(
CACHE_SET_RUNNING
,
&
c
->
flags
);
return
;
return
;
err:
err:
closure_sync
(
&
cl
);
closure_sync
(
&
cl
);
...
...
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