From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D619BC433DB for ; Sat, 20 Feb 2021 21:10:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9EF2664E5F for ; Sat, 20 Feb 2021 21:10:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229867AbhBTVJq (ORCPT ); Sat, 20 Feb 2021 16:09:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229849AbhBTVJp (ORCPT ); Sat, 20 Feb 2021 16:09:45 -0500 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD198C061574; Sat, 20 Feb 2021 13:09:05 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1lDZUl-00GQzx-U4; Sat, 20 Feb 2021 21:08:56 +0000 Date: Sat, 20 Feb 2021 21:08:55 +0000 From: Al Viro To: Cong Wang Cc: Denis Kirjanov , Christoph Hellwig , LKML , Jakub Kicinski , linux-fsdevel Subject: Re: [PATCH 1/8] af_unix: take address assignment/hash insertion into a new helper Message-ID: References: <20210129131855.GA2346744@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Sat, Feb 20, 2021 at 12:31:49PM -0800, Cong Wang wrote: > Because it does not lock the lock, just compare: > > lock(); > __unix_set_addr(); > unlock(); > > to: > > lock(); > __unix_set_addr(); > > Clearly the former is more readable and less error-prone. Even > if you really want to do unlock, pick a name which explicitly says > it, for example, __unix_set_addr_unlock(). *shrug* If anything, __unix_complete_bind() might make a better name for that, with dropping ->bindlock also pulled in, but TBH I don't have sufficiently strong preferences - might as well leave dropping the lock to caller. I'll post that series to netdev tonight.