diff options
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r-- | drivers/md/dm-ioctl.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 07d44e19536e..561bda5011e0 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c | |||
@@ -270,6 +270,7 @@ static int dm_hash_rename(const char *old, const char *new) | |||
270 | { | 270 | { |
271 | char *new_name, *old_name; | 271 | char *new_name, *old_name; |
272 | struct hash_cell *hc; | 272 | struct hash_cell *hc; |
273 | struct dm_table *table; | ||
273 | 274 | ||
274 | /* | 275 | /* |
275 | * duplicate new. | 276 | * duplicate new. |
@@ -317,6 +318,15 @@ static int dm_hash_rename(const char *old, const char *new) | |||
317 | /* rename the device node in devfs */ | 318 | /* rename the device node in devfs */ |
318 | register_with_devfs(hc); | 319 | register_with_devfs(hc); |
319 | 320 | ||
321 | /* | ||
322 | * Wake up any dm event waiters. | ||
323 | */ | ||
324 | table = dm_get_table(hc->md); | ||
325 | if (table) { | ||
326 | dm_table_event(table); | ||
327 | dm_table_put(table); | ||
328 | } | ||
329 | |||
320 | up_write(&_hash_lock); | 330 | up_write(&_hash_lock); |
321 | kfree(old_name); | 331 | kfree(old_name); |
322 | return 0; | 332 | return 0; |
@@ -683,14 +693,18 @@ static int dev_rename(struct dm_ioctl *param, size_t param_size) | |||
683 | static int do_suspend(struct dm_ioctl *param) | 693 | static int do_suspend(struct dm_ioctl *param) |
684 | { | 694 | { |
685 | int r = 0; | 695 | int r = 0; |
696 | int do_lockfs = 1; | ||
686 | struct mapped_device *md; | 697 | struct mapped_device *md; |
687 | 698 | ||
688 | md = find_device(param); | 699 | md = find_device(param); |
689 | if (!md) | 700 | if (!md) |
690 | return -ENXIO; | 701 | return -ENXIO; |
691 | 702 | ||
703 | if (param->flags & DM_SKIP_LOCKFS_FLAG) | ||
704 | do_lockfs = 0; | ||
705 | |||
692 | if (!dm_suspended(md)) | 706 | if (!dm_suspended(md)) |
693 | r = dm_suspend(md); | 707 | r = dm_suspend(md, do_lockfs); |
694 | 708 | ||
695 | if (!r) | 709 | if (!r) |
696 | r = __dev_status(md, param); | 710 | r = __dev_status(md, param); |
@@ -702,6 +716,7 @@ static int do_suspend(struct dm_ioctl *param) | |||
702 | static int do_resume(struct dm_ioctl *param) | 716 | static int do_resume(struct dm_ioctl *param) |
703 | { | 717 | { |
704 | int r = 0; | 718 | int r = 0; |
719 | int do_lockfs = 1; | ||
705 | struct hash_cell *hc; | 720 | struct hash_cell *hc; |
706 | struct mapped_device *md; | 721 | struct mapped_device *md; |
707 | struct dm_table *new_map; | 722 | struct dm_table *new_map; |
@@ -727,8 +742,10 @@ static int do_resume(struct dm_ioctl *param) | |||
727 | /* Do we need to load a new map ? */ | 742 | /* Do we need to load a new map ? */ |
728 | if (new_map) { | 743 | if (new_map) { |
729 | /* Suspend if it isn't already suspended */ | 744 | /* Suspend if it isn't already suspended */ |
745 | if (param->flags & DM_SKIP_LOCKFS_FLAG) | ||
746 | do_lockfs = 0; | ||
730 | if (!dm_suspended(md)) | 747 | if (!dm_suspended(md)) |
731 | dm_suspend(md); | 748 | dm_suspend(md, do_lockfs); |
732 | 749 | ||
733 | r = dm_swap_table(md, new_map); | 750 | r = dm_swap_table(md, new_map); |
734 | if (r) { | 751 | if (r) { |