1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

Fix dm_udev_wait calls in dmsetup to occur before readahead display not after.

Include an implicit dm_task_update_nodes() within dm_udev_wait().
This commit is contained in:
Alasdair Kergon 2011-03-02 00:29:57 +00:00
parent 5993dc5b48
commit 9a45e3dbbb
5 changed files with 23 additions and 16 deletions

View File

@ -1,5 +1,7 @@
Version 1.02.64 - Version 1.02.64 -
=================================== ===================================
Fix dm_udev_wait calls in dmsetup to occur before readahead display not after.
Include an implicit dm_task_update_nodes() within dm_udev_wait().
Fix _create_and_load_v4 not to lose the --addnodeoncreate setting (1.02.62). Fix _create_and_load_v4 not to lose the --addnodeoncreate setting (1.02.62).
Add inactive table query support for kernel driver >= 4.11.6 (RHEL 5.7). Add inactive table query support for kernel driver >= 4.11.6 (RHEL 5.7).
Log debug open_count in _node_has_closed_parents(). Log debug open_count in _node_has_closed_parents().

View File

@ -2025,7 +2025,8 @@ static struct dm_ioctl *_do_dm_ioctl(struct dm_task *dmt, unsigned command,
} }
} }
if (ioctl_with_uevent && !_check_uevent_generated(dmi)) { if (ioctl_with_uevent && dm_udev_get_sync_support() &&
!_check_uevent_generated(dmi)) {
log_debug("Uevent not generated! Calling udev_complete " log_debug("Uevent not generated! Calling udev_complete "
"internally to avoid process lock-up."); "internally to avoid process lock-up.");
_udev_complete(dmt); _udev_complete(dmt);

View File

@ -1044,6 +1044,8 @@ int dm_udev_complete(uint32_t cookie)
int dm_udev_wait(uint32_t cookie) int dm_udev_wait(uint32_t cookie)
{ {
update_devs();
return 1; return 1;
} }
@ -1380,7 +1382,7 @@ int dm_udev_complete(uint32_t cookie)
return 1; return 1;
} }
int dm_udev_wait(uint32_t cookie) static int _udev_wait(uint32_t cookie)
{ {
int semid; int semid;
struct sembuf sb = {0, 0, 0}; struct sembuf sb = {0, 0, 0};
@ -1420,4 +1422,11 @@ repeat_wait:
return _udev_notify_sem_destroy(cookie, semid); return _udev_notify_sem_destroy(cookie, semid);
} }
int dm_udev_wait(uint32_t cookie)
{
int r = _udev_wait(cookie);
update_devs();
}
#endif /* UDEV_SYNC_SUPPORT */ #endif /* UDEV_SYNC_SUPPORT */

View File

@ -1922,7 +1922,6 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
if (!dm_udev_wait(dm_tree_get_cookie(dnode))) if (!dm_udev_wait(dm_tree_get_cookie(dnode)))
stack; stack;
dm_tree_set_cookie(dnode, 0); dm_tree_set_cookie(dnode, 0);
dm_task_update_nodes();
} }
return r; return r;

View File

@ -658,19 +658,13 @@ static int _create(int argc, char **argv, void *data __attribute__((unused)))
r = 1; r = 1;
if (!_udev_cookie)
(void) dm_udev_wait(cookie);
if (_switches[VERBOSE_ARG])
r = _display_info(dmt);
dm_task_destroy(dmt);
return r;
out: out:
if (!_udev_cookie) if (!_udev_cookie)
(void) dm_udev_wait(cookie); (void) dm_udev_wait(cookie);
if (r && _switches[VERBOSE_ARG])
r = _display_info(dmt);
dm_task_destroy(dmt); dm_task_destroy(dmt);
return r; return r;
@ -721,6 +715,7 @@ static int _rename(int argc, char **argv, void *data __attribute__((unused)))
out: out:
if (!_udev_cookie) if (!_udev_cookie)
(void) dm_udev_wait(cookie); (void) dm_udev_wait(cookie);
dm_task_destroy(dmt); dm_task_destroy(dmt);
return r; return r;
@ -1242,14 +1237,15 @@ static int _simple(int task, const char *name, uint32_t event_nr, int display)
r = dm_task_run(dmt); r = dm_task_run(dmt);
if (r && display && _switches[VERBOSE_ARG])
r = _display_info(dmt);
out: out:
if (!_udev_cookie && udev_wait_flag) if (!_udev_cookie && udev_wait_flag)
(void) dm_udev_wait(cookie); (void) dm_udev_wait(cookie);
if (r && display && _switches[VERBOSE_ARG])
r = _display_info(dmt);
dm_task_destroy(dmt); dm_task_destroy(dmt);
return r; return r;
} }