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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 7867BC4332B for ; Mon, 22 Feb 2021 19:18:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 416DD64E4B for ; Mon, 22 Feb 2021 19:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233225AbhBVTS0 (ORCPT ); Mon, 22 Feb 2021 14:18:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232990AbhBVTNN (ORCPT ); Mon, 22 Feb 2021 14:13:13 -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 2EC63C0617A9; Mon, 22 Feb 2021 11:12:33 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1lEGdB-00HB0i-B9; Mon, 22 Feb 2021 19:12:29 +0000 Date: Mon, 22 Feb 2021 19:12:29 +0000 From: Al Viro To: netdev@vger.kernel.org Cc: Denis Kirjanov , Christoph Hellwig , LKML , Jakub Kicinski , linux-fsdevel , Cong Wang Subject: Re: [PATCHSET] making unix_bind() undo mknod on failure Message-ID: References: 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-kernel@vger.kernel.org On Mon, Feb 22, 2021 at 07:06:00PM +0000, Al Viro wrote: > On Sat, Feb 20, 2021 at 09:08:56PM +0000, Al Viro wrote: > > > *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. > > Took longer than I hoped... Anyway, here's the current variant; > it's 5.11-based, lives in > git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git misc.af_unix > > Shortlog: > Al Viro (8): > af_unix: take address assignment/hash insertion into a new helper > unix_bind(): allocate addr earlier > unix_bind(): separate BSD and abstract cases > unix_bind(): take BSD and abstract address cases into new helpers > fold unix_mknod() into unix_bind_bsd() > unix_bind_bsd(): move done_path_create() call after dealing with ->bindlock > unix_bind_bsd(): unlink if we fail after successful mknod > __unix_find_socket_byname(): don't pass hash and type separately > > Diffstat: > net/unix/af_unix.c | 186 +++++++++++++++++++++++++++-------------------------- > 1 file changed, 94 insertions(+), 92 deletions(-) > > The actual fix is in #7/8, the first 6 are massage in preparation to that > and #8/8 is a minor followup cleanup. Individual patches in followups. > Please, review. Argh... git send-email is playing silly buggers again ;-/