diff options
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r-- | drivers/md/dm-snap.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index ee8eb283650d..0789c22ff0d4 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -1081,8 +1081,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
1081 | argv++; | 1081 | argv++; |
1082 | argc--; | 1082 | argc--; |
1083 | 1083 | ||
1084 | r = dm_get_device(ti, cow_path, 0, 0, | 1084 | r = dm_get_device(ti, cow_path, FMODE_READ | FMODE_WRITE, &s->cow); |
1085 | FMODE_READ | FMODE_WRITE, &s->cow); | ||
1086 | if (r) { | 1085 | if (r) { |
1087 | ti->error = "Cannot get COW device"; | 1086 | ti->error = "Cannot get COW device"; |
1088 | goto bad_cow; | 1087 | goto bad_cow; |
@@ -1098,7 +1097,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
1098 | argv += args_used; | 1097 | argv += args_used; |
1099 | argc -= args_used; | 1098 | argc -= args_used; |
1100 | 1099 | ||
1101 | r = dm_get_device(ti, origin_path, 0, ti->len, origin_mode, &s->origin); | 1100 | r = dm_get_device(ti, origin_path, origin_mode, &s->origin); |
1102 | if (r) { | 1101 | if (r) { |
1103 | ti->error = "Cannot get origin device"; | 1102 | ti->error = "Cannot get origin device"; |
1104 | goto bad_origin; | 1103 | goto bad_origin; |
@@ -2100,8 +2099,7 @@ static int origin_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
2100 | return -EINVAL; | 2099 | return -EINVAL; |
2101 | } | 2100 | } |
2102 | 2101 | ||
2103 | r = dm_get_device(ti, argv[0], 0, ti->len, | 2102 | r = dm_get_device(ti, argv[0], dm_table_get_mode(ti->table), &dev); |
2104 | dm_table_get_mode(ti->table), &dev); | ||
2105 | if (r) { | 2103 | if (r) { |
2106 | ti->error = "Cannot get target device"; | 2104 | ti->error = "Cannot get target device"; |
2107 | return r; | 2105 | return r; |