Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755985AbcCBBN7 (ORCPT ); Tue, 1 Mar 2016 20:13:59 -0500 Received: from mail333.us4.mandrillapp.com ([205.201.137.77]:56744 "EHLO mail333.us4.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755655AbcCAXzm (ORCPT ); Tue, 1 Mar 2016 18:55:42 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=mandrill; d=linuxfoundation.org; b=LmJPa0W4AYpdMvCiGzW1sR2yFePgYR1U4jAgtgx5D7eXXcZuimY4K0zJHE0bVn9NejkE6LTM999i RqIVLzDcaQKojPTFdJH009YJkVklSUdBZcZKjcxcd1BuNybhOiOY74CgWaHNOnxcaiJMixfr75r8 x117QA64HAM9KDX6zTA=; From: Greg Kroah-Hartman Subject: [PATCH 4.4 067/342] bcache: allows use of register in udev to avoid "device_busy" error. X-Mailer: git-send-email 2.7.2 To: Cc: Greg Kroah-Hartman , , Denis Bychkov , Kent Overstreet , Eric Wheeler , Gabriel de Perthuis , Jens Axboe Message-Id: <20160301234530.164332017@linuxfoundation.org> In-Reply-To: <20160301234527.990448862@linuxfoundation.org> References: <20160301234527.990448862@linuxfoundation.org> X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30481620.62efde8944e3419a832e7b59418f66e7 X-Mandrill-User: md_30481620 Date: Tue, 01 Mar 2016 23:54:06 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1445 Lines: 46 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gabriel de Perthuis commit d7076f21629f8f329bca4a44dc408d94670f49e2 upstream. Allows to use register, not register_quiet in udev to avoid "device_busy" error. The initial patch proposed at https://lkml.org/lkml/2013/8/26/549 by Gabriel de Perthuis does not unlock the mutex and hangs the kernel. See http://thread.gmane.org/gmane.linux.kernel.bcache.devel/2594 for the discussion. Cc: Denis Bychkov Cc: Kent Overstreet Cc: Eric Wheeler Cc: Gabriel de Perthuis Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/md/bcache/super.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1938,6 +1938,8 @@ static ssize_t register_bcache(struct ko else err = "device busy"; mutex_unlock(&bch_register_lock); + if (attr == &ksysfs_register_quiet) + goto out; } goto err; } @@ -1976,8 +1978,7 @@ out: err_close: blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL); err: - if (attr != &ksysfs_register_quiet) - pr_info("error opening %s: %s", path, err); + pr_info("error opening %s: %s", path, err); ret = -EINVAL; goto out; }