From patchwork Thu Jan 28 13:27:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Broz X-Patchwork-Id: 75588 X-Patchwork-Delegate: agk@redhat.com Received: from mx01.util.phx2.redhat.com (mx1-phx2.redhat.com [209.132.183.26]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o0SERRkb018641 for ; Thu, 28 Jan 2010 14:28:03 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx01.util.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0SDS6wM020183; Thu, 28 Jan 2010 08:28:10 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0SDS5ts020040 for ; Thu, 28 Jan 2010 08:28:05 -0500 Received: from localhost.localdomain (mazybook.englab.brq.redhat.com [10.34.32.183]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0SDRwq0006943; Thu, 28 Jan 2010 08:27:59 -0500 From: Milan Broz To: dm-devel@redhat.com Date: Thu, 28 Jan 2010 14:27:55 +0100 Message-Id: <1264685275-21232-1-git-send-email-mbroz@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-loop: dm-devel@redhat.com Cc: Milan Broz Subject: [dm-devel] [PATCH] Do not wait for event on device without table. X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 28 Jan 2010 14:28:03 +0000 (UTC) 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)) {