Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6076548ybv; Tue, 18 Feb 2020 09:24:09 -0800 (PST) X-Google-Smtp-Source: APXvYqw6uioDRzwypMsbQ7hWoZJeawqGTZVO6xh1XlAh+ONMDbNLV4JpPctuapERyUkRaai7TPuy X-Received: by 2002:a9d:7086:: with SMTP id l6mr15957518otj.294.1582046649235; Tue, 18 Feb 2020 09:24:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582046649; cv=none; d=google.com; s=arc-20160816; b=1AX2rdf6+rGWKJnYk3iQa6md7BBMwNPNlpZC80Clr27BP9SW2eSAaj3bgZ5JDAUw/m plLQMu2/aCK1m5kNGLrh7JF9yIPpcYR/HtSVkdXzK9+/zcFmLz2Ha4zde01N8M7xKOPy QCu+7IvKdkcI4aiDy+UrOEJYin6BHotC+0AQLzat8T0kFOoQpFTfm7tWUvKpRCTgmdUH Pn3Ry2T2lf4BJRawM8ZX/KYAtjdvQJbrHFDUznWspvKdf4lXWCc3wYZ+jvh9MVvNn0Nl vZh9AfgbISAk1K2Yt1u/3ouHFMfpeA9a8ec4YbG7x90kF8c1oGXkZmajCEf0e+wZcmXO 353A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=L93uXmdo1WB0FttPt2OeEARmgFjlBb7DbeNFDjVlnbs=; b=pU31bPY62DLx0n9q0phpULY0OQsZx/Tof4nNUMTyfCntYWuQYZzwJoDLiw2JgRCo95 71YzOYkfurmPgi4cqZxljJnURcT7kGaNnHb5VA9cGke2ScKn0P8JbT75Zc+y1RfT9rFv RPuE3ZNxmFBIzIwxhbuNjac2plD42lcfUi/f3p3RUIZC+bqpLxgpQsGWkYXGnQmJo2Tj uyQ6Ha+gf4AvmyYfdxjPY/aS6b2fN/wTSFqhu7kyvV6Jvd+d2BclxXtLXNet66+6Ncd+ a2Z+M1dFff4FAA6mxQGpBedWsgoVmuzb8YupFwJCUvjwFKtORgBzUx0MMkW3iBFjrbxT TC7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SNf5w0nJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w18si2173220otl.54.2020.02.18.09.23.57; Tue, 18 Feb 2020 09:24:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SNf5w0nJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726707AbgBRRXt (ORCPT + 99 others); Tue, 18 Feb 2020 12:23:49 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:48646 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726638AbgBRRXs (ORCPT ); Tue, 18 Feb 2020 12:23:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=L93uXmdo1WB0FttPt2OeEARmgFjlBb7DbeNFDjVlnbs=; b=SNf5w0nJ40hyIPTGzU9jLx7RpP ++jkwmG0HF+sV1aJLZKOnzCvYzR7qqQkFJe4xqg8qvqGTjcqXD3JlNlzlZw6T+v991Di+KM8WP8qf Df5Ry8y5nhWbfX8S64+XLRM0NjUA1FLZBdFvZyEvf9F+hOzZFHYKJ61lrjJCZi9zAgnpTHuzaz5Fb +NOoBNCach/FxA6/Q1qkqju59ezoHwJH3MdrOilCD2apvIapDQ0v5lY2Z48/a7n3Zc1ful6QTWc2m po0g+R1H70dY6bFgfrHEUZFKP9FHyWPdTmFG+79cflsqJL+wvVHl/nzgFVt3uHHYASFB2NzWDUhAs kOxmrGwA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j46b5-00015A-OT; Tue, 18 Feb 2020 17:23:47 +0000 Date: Tue, 18 Feb 2020 09:23:47 -0800 From: Christoph Hellwig To: James Bottomley Cc: Christoph Hellwig , Merlijn Wajer , merlijn@wizzup.org, linux-scsi@vger.kernel.org, Jens Axboe , "Martin K. Petersen" , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] scsi: sr: get rid of sr global mutex Message-ID: <20200218172347.GA3020@infradead.org> References: <20200218143918.30267-1-merlijn@archive.org> <20200218171259.GA6724@infradead.org> <1582046428.16681.7.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1582046428.16681.7.camel@linux.ibm.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 18, 2020 at 09:20:28AM -0800, James Bottomley wrote: > > > Replace the global mutex with per-sr-device mutex. > > > > Do we actually need the lock at all? What is protected by it? > > We do at least for cdrom_open. It modifies the cdi structure with no > other protection and concurrent modification would at least screw up > the use counter which is not atomic. Same reasoning for cdrom_release. Wouldn't the right fix to add locking to cdrom_open/release instead of having an undocumented requirement for the callers?