From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 344A2175A8F for ; Wed, 17 Jun 2026 01:26:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781659621; cv=none; b=svUV7VlsoT6dWBhHlqBrFts0UOV5wmGZ54MaqHwNMTNTnwuW69hiARNeHgwQGmW8WwjPKnxaGWtLJcAzLAGwXjAB/2b4di1Vo3fhXTV6rZDXKCIP7Gp6oC1FKmkIb5nWaoD5e3mCoSz4DVNyS0/jCNZqxSqvqLwmBjCH0j89hAc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781659621; c=relaxed/simple; bh=eu5NHMH7qQQqFzKMengQ5ZuUjMcSDOWGNzTL1lgeFPY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=u+jSLJIizf78vAZDDPAbFWmBh0CWc+glQ6EDMaH8SgWlbjF3mqGg4hRrjzGyCj1mCksIqMT5RC1Wn8qVw66pAzWEcVxbTtLM8gv1+bsw3MJRcINJxHmJ73vyjS84vFO8fwL3+GYRXqRpj/GGS2Plw+sgnngOaxKICkIjTR3KCok= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pAbm8Vqp; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="pAbm8Vqp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F298C1F000E9; Wed, 17 Jun 2026 01:26:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781659619; bh=bFbKQGCnVupRMDP4IDFmitSpImSlpiUAfzAEjbc+YqA=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=pAbm8VqpUeA4e56cJnPIbSbVb/5nGyTjtx97Z78lMM+jp8IAIxS2G08ojB6q+IEZS lnmtX6nRzoi+jF5ZmbGQKL4pu/g9XgrU03Pv8tI02j/eAEveK0fE5fAozw0vWTqG8T D54kDktsLmqF8WxB8uJi5lfLwsbvARNA8Q1lAH2I= Date: Wed, 17 Jun 2026 06:55:53 +0530 From: Greg KH To: Biren Pandya Cc: arve@android.com, tkjos@android.com, brauner@kernel.org, cmllamas@google.com, aliceryhl@google.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] android: binderfs: drop manual unlock via scoped_guard() Message-ID: <2026061704-study-sandbank-89a8@gregkh> References: <20260616175340.60355-2-birenpandya@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260616175340.60355-2-birenpandya@gmail.com> On Tue, Jun 16, 2026 at 11:23:41PM +0530, Biren Pandya wrote: > The device_create function manually protects the minor number allocation > with binderfs_minors_mutex and relies on multiple manual unlocks on > success and error paths. This is error-prone and adds boilerplate. > > Refactor the critical section to use the modern scoped_guard(mutex) > macro. This strictly binds the lock lifecycle to the scope block, > completely eliminating the manual unlocks and guaranteeing lock > safety against future code modifications. We don't do scope guard changes that don't actually fix a bug, as it's not needed. Otherwise we would be rewriting large chunks of the kernel for it. thanks, greg k-h