diff mbox

Do not wait for event on device without table.

Message ID 1264685275-21232-1-git-send-email-mbroz@redhat.com (mailing list archive)
State Changes Requested, archived
Delegated to: Alasdair Kergon
Headers show

Commit Message

Milan Broz Jan. 28, 2010, 1:27 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 1d66932..a0ac379 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1023,6 +1023,15 @@  static int dev_wait(struct dm_ioctl *param, size_t param_size)
 		return -ENXIO;
 
 	/*
+	 * Do not wait if no table present
+	 */
+	if (!(table = dm_get_live_or_inactive_table(md, param))) {
+		r = -ENXIO;
+		goto out;
+	}
+	dm_table_put(table);
+
+	/*
 	 * Wait for a notification event
 	 */
 	if (dm_wait_event(md, param->event_nr)) {