From patchwork Tue Jun 8 10:25:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiyoshi Ueda X-Patchwork-Id: 104927 X-Patchwork-Delegate: agk@redhat.com Received: from mx01.colomx.prod.int.phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o58AVB9F017234 for ; Tue, 8 Jun 2010 10:31:46 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx01.colomx.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o58ASl0V014665; Tue, 8 Jun 2010 06:28:47 -0400 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 o58ASkhc002483 for ; Tue, 8 Jun 2010 06:28:46 -0400 Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.12]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o58ASeJg025681; Tue, 8 Jun 2010 06:28:40 -0400 Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o58ASUwt016081; Tue, 8 Jun 2010 06:28:31 -0400 Received: from mailgate3.nec.co.jp ([10.7.69.193]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id o58ASUYN008108; Tue, 8 Jun 2010 19:28:30 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id o58ASUw23274; Tue, 8 Jun 2010 19:28:30 +0900 (JST) Received: from mail02.kamome.nec.co.jp (mail02.kamome.nec.co.jp [10.25.43.5]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id o58ASTFF009589; Tue, 8 Jun 2010 19:28:29 +0900 (JST) Received: from komachi.jp.nec.com ([10.26.220.10] [10.26.220.10]) by mail02.kamome.nec.co.jp with ESMTP id BT-MMP-3406005; Tue, 8 Jun 2010 19:25:52 +0900 Received: from elcondor.linux.bs1.fc.nec.co.jp ([10.34.125.146] [10.34.125.146]) by mail.jp.nec.com with ESMTP; Tue, 8 Jun 2010 19:25:51 +0900 Message-ID: <4C0E1AAD.1050108@ct.jp.nec.com> Date: Tue, 08 Jun 2010 19:25:49 +0900 From: Kiyoshi Ueda User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: Alasdair Kergon References: <4C0E19A0.1040804@ct.jp.nec.com> In-Reply-To: <4C0E19A0.1040804@ct.jp.nec.com> X-RedHat-Spam-Score: -0.002 (SPF_HELO_PASS,SPF_PASS) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.12 X-loop: dm-devel@redhat.com Cc: device-mapper development Subject: [dm-devel] [PATCH 1/3] dm: prevent access to md being deleted 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: , 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]); Tue, 08 Jun 2010 10:31:46 +0000 (UTC) Index: 2.6.35-rc1/drivers/md/dm.c =================================================================== --- 2.6.35-rc1.orig/drivers/md/dm.c +++ 2.6.35-rc1/drivers/md/dm.c @@ -2141,6 +2141,7 @@ static struct mapped_device *dm_find_md( md = idr_find(&_minor_idr, minor); if (md && (md == MINOR_ALLOCED || (MINOR(disk_devt(dm_disk(md))) != minor) || + dm_deleting_md(md) || test_bit(DMF_FREEING, &md->flags))) { md = NULL; goto out;