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
1006c21b
Commit
1006c21b
authored
Jan 07, 2003
by
Joe Thornber
Committed by
Trond Myklebust
Jan 07, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] dm: printk tgt->error if dm_table_add_target() fails.
printk tgt->error if dm_table_add_target() fails.
parent
20bf21d4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
drivers/md/dm-table.c
drivers/md/dm-table.c
+15
-16
No files found.
drivers/md/dm-table.c
View file @
1006c21b
...
...
@@ -578,9 +578,8 @@ static int split_args(int max, int *argc, char **argv, char *input)
int
dm_table_add_target
(
struct
dm_table
*
t
,
const
char
*
type
,
sector_t
start
,
sector_t
len
,
char
*
params
)
{
int
r
,
argc
;
int
r
=
-
EINVAL
,
argc
;
char
*
argv
[
32
];
struct
target_type
*
tt
;
struct
dm_target
*
tgt
;
if
((
r
=
check_space
(
t
)))
...
...
@@ -589,14 +588,13 @@ int dm_table_add_target(struct dm_table *t, const char *type,
tgt
=
t
->
targets
+
t
->
num_targets
;
memset
(
tgt
,
0
,
sizeof
(
*
tgt
));
t
t
=
dm_get_target_type
(
type
);
if
(
!
t
t
)
{
t
gt
->
type
=
dm_get_target_type
(
type
);
if
(
!
t
gt
->
type
)
{
tgt
->
error
=
"unknown target type"
;
return
-
EINVAL
;
goto
bad
;
}
tgt
->
table
=
t
;
tgt
->
type
=
tt
;
tgt
->
begin
=
start
;
tgt
->
len
=
len
;
tgt
->
error
=
"Unknown error"
;
...
...
@@ -605,23 +603,19 @@ int dm_table_add_target(struct dm_table *t, const char *type,
* Does this target adjoin the previous one ?
*/
if
(
!
adjoin
(
t
,
tgt
))
{
DMERR
(
"Gap in table"
);
dm_put_target_type
(
tt
);
return
-
EINVAL
;
tgt
->
error
=
"Gap in table"
;
goto
bad
;
}
r
=
split_args
(
ARRAY_SIZE
(
argv
),
&
argc
,
argv
,
params
);
if
(
r
)
{
tgt
->
error
=
"couldn't split parameters"
;
dm_put_target_type
(
tt
);
return
r
;
goto
bad
;
}
r
=
tt
->
ctr
(
tgt
,
argc
,
argv
);
if
(
r
)
{
dm_put_target_type
(
tt
);
return
r
;
}
r
=
tgt
->
type
->
ctr
(
tgt
,
argc
,
argv
);
if
(
r
)
goto
bad
;
t
->
highs
[
t
->
num_targets
++
]
=
tgt
->
begin
+
tgt
->
len
-
1
;
...
...
@@ -629,6 +623,11 @@ int dm_table_add_target(struct dm_table *t, const char *type,
* the merge fn apply the target level restrictions. */
combine_restrictions_low
(
&
t
->
limits
,
&
tgt
->
limits
);
return
0
;
bad:
printk
(
KERN_ERR
DM_NAME
": %s
\n
"
,
tgt
->
error
);
dm_put_target_type
(
tgt
->
type
);
return
r
;
}
static
int
setup_indexes
(
struct
dm_table
*
t
)
...
...
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