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 E8D38C433DB for ; Mon, 22 Feb 2021 19:08:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B212964E27 for ; Mon, 22 Feb 2021 19:08:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232755AbhBVTIJ (ORCPT ); Mon, 22 Feb 2021 14:08:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232748AbhBVTGt (ORCPT ); Mon, 22 Feb 2021 14:06:49 -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 76DBAC06178C; Mon, 22 Feb 2021 11:06:09 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1lEGWu-00HAo8-GG; Mon, 22 Feb 2021 19:06:01 +0000 Date: Mon, 22 Feb 2021 19:06:00 +0000 From: Al Viro To: netdev@vger.kernel.org Cc: Denis Kirjanov , Christoph Hellwig , LKML , Jakub Kicinski , linux-fsdevel , Cong Wang Subject: [PATCHSET] making unix_bind() undo mknod on failure 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: netdev@vger.kernel.org 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.