diff options
author | Milan Broz <mbroz@redhat.com> | 2011-03-24 14:52:14 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2011-03-24 14:52:14 +0100 |
commit | 024d37e95ec4a7ccc256973ab2feab01f4fbdd2d (patch) | |
tree | f81ce3ac56c911577942b8404ed45a980c321621 /drivers/md/dm-log.c | |
parent | Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiw... (diff) | |
download | linux-024d37e95ec4a7ccc256973ab2feab01f4fbdd2d.tar.xz linux-024d37e95ec4a7ccc256973ab2feab01f4fbdd2d.zip |
dm: fix opening log and cow devices for read only tables
If a table is read-only, also open any log and cow devices it uses read-only.
Previously, even read-only devices were opened read-write internally.
After patch 75f1dc0d076d1c1168f2115f1941ea627d38bd5a
block: check bdev_read_only() from blkdev_get()
was applied, loading such tables began to fail. The patch
was reverted by e51900f7d38cbcfb481d84567fd92540e7e1d23a
block: revert block_dev read-only check
but this patch fixes this part of the code to work with the original patch.
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-log.c')
-rw-r--r-- | drivers/md/dm-log.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c index 6951536ea29c..8e8a868ca857 100644 --- a/drivers/md/dm-log.c +++ b/drivers/md/dm-log.c @@ -543,7 +543,7 @@ static int disk_ctr(struct dm_dirty_log *log, struct dm_target *ti, return -EINVAL; } - r = dm_get_device(ti, argv[0], FMODE_READ | FMODE_WRITE, &dev); + r = dm_get_device(ti, argv[0], dm_table_get_mode(ti->table), &dev); if (r) return r; |