From patchwork Wed Aug 4 15:40:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 117071 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o74FesMa004658 for ; Wed, 4 Aug 2010 15:40:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754486Ab0HDPkq (ORCPT ); Wed, 4 Aug 2010 11:40:46 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:54770 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754442Ab0HDPkn (ORCPT ); Wed, 4 Aug 2010 11:40:43 -0400 Received: by bwz1 with SMTP id 1so2463166bwz.19 for ; Wed, 04 Aug 2010 08:40:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=Ypx6uDhBgQANb0TazLpnpRXR5bhHvNS4N99qNj8abDQ=; b=ILuGA2fZ1N/SNgz264Yo9g5qF3Ti4zs36hRbvySMYhh07OnGj0KqrvmwdGMJiCbZG/ Z03yEom5xj1q09Inm4rrD+XGxjBn1jFbVy3+vfeLUmQmeOQqLw+TUk2Mvs0PlL20TMBM 23/2/lxXw7NdKTavJnKaGUYkxArimcO1H/t2s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=W0Q1jXKn53UB60NLhMZhEfLYMJr2Ir2SYQi3OlQM2JxNMFSTkMUanxUAStoTz7y73R cgq1hPF8DnnP8XbhteNoUZbn6WMo/zRpqfQvDZk3Yd7DZ4TfQVyikt3bjazFYTOxjD9r 4NAI914hR7X/Pk/XMKGiE10TGzdUfRYPpFu8E= Received: by 10.204.81.130 with SMTP id x2mr6304227bkk.210.1280936440668; Wed, 04 Aug 2010 08:40:40 -0700 (PDT) Received: from htj.dyndns.org ([130.75.117.88]) by mx.google.com with ESMTPS id f10sm6039682bkl.5.2010.08.04.08.40.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 04 Aug 2010 08:40:38 -0700 (PDT) Received: from [127.0.0.2] (htj.dyndns.org [127.0.0.2]) by htj.dyndns.org (Postfix) with ESMTPSA id 7B0361CC0555; Wed, 4 Aug 2010 17:40:59 +0200 (CEST) Message-ID: <4C598A0B.9000301@gmail.com> Date: Wed, 04 Aug 2010 17:40:59 +0200 From: Tejun Heo User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 MIME-Version: 1.0 To: Jens Axboe CC: "Rafael J. Wysocki" , Linux Kernel Mailing List , Maciej Rutecki , Andrew Morton , Kernel Testers List , Network Development , Linux ACPI , Linux PM List , Linux SCSI List , Linux Wireless List , DRI , Linus Torvalds , stable@kernel.org, Maciej Rutecki Subject: [PATCH block#for-2.6.36] block_dev: always serialize exclusive open attempts References: <2dWFdr9kTFM.A.P0D.spXVMB@chimera> <4C56F30D.3020304@kernel.org> In-Reply-To: <4C56F30D.3020304@kernel.org> X-Enigmail-Version: 1.1.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 04 Aug 2010 15:40:54 +0000 (UTC) diff --git a/fs/block_dev.c b/fs/block_dev.c index 99d6af8..b3171fb 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -681,8 +681,8 @@ retry: if (!bd_may_claim(bdev, whole, holder)) return -EBUSY; - /* if someone else is claiming, wait for it to finish */ - if (whole->bd_claiming && whole->bd_claiming != holder) { + /* if claiming is already in progress, wait for it to finish */ + if (whole->bd_claiming) { wait_queue_head_t *wq = bit_waitqueue(&whole->bd_claiming, 0); DEFINE_WAIT(wait);