Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1806220pxb; Mon, 22 Feb 2021 11:20:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJySpNSVNXOaHV90uAEqzsefEm4aFlRw/nT5ovepfWy/3iLHknNqGdkBurWReYrDL1evAGEW X-Received: by 2002:a17:906:4543:: with SMTP id s3mr22190199ejq.258.1614021612817; Mon, 22 Feb 2021 11:20:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614021612; cv=none; d=google.com; s=arc-20160816; b=yoDU8LpC2RFuIm7xew6PldozCgHsvhfzfHNJdhZ7mfheyOkB1KHI9ZIuOwNveR9+WX HcBG1BHrB2lo9pnDqcurgNJQ9Fwi04UuAAFEC02rxeJN9fm6+6mP5fyxLZvsr8ukqIaA /SdSwKJknYciWS7ihA3mircq8zbLRxbTAIX6HWgUXIGNTjSpmA0DO7XfLo+6il2ENGEv z1OJ4MiqZAUoC2NzMaMaTcyF1IHvhjT0bl4Qxn+arIHy3nKKopbPPfUTOiH/6ZG+ecQD Bp5k6+KAllNkrTR5xT/q/IqJbu1wqr+e53s0XG5ps46Xgq4g5RpOvaGJcm6jt5E2t9gG EQqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=9Z1Z19FKoIWK2KwNihu9ev/YWO81L6CKL+r/TyRD/BA=; b=Vmln/x9E9Di66doXbRsUagTyFzYDm4pInLGKTyba8KoOlZq2hbbOm2Zykw9arO7bY1 5EV680RWFzwHKVkpi/Dbb2z6jim1NdyMs4VLcjazPU3QZBqYC1VXJP9uGKaStkmaG7R3 pRSfTgorQVn6M0QDTzIrt3xa6nfzrt4Ah/UKLjhc35bZIppGMCAR11DOQMFDQMQbE9jj wCHvDUPdLPdplQWHi25nkKt9vzTkXm6B2TWI+cIXYNxMVEOY3sQYArETY7y4uQTomZHB JN0uoJX1edkAHxzjWO8yPXV5jOYkqMmojBHZFGdZFk4zEitxUxTH6rrCD/sjDTwSU8kb gPXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o3si4660855edv.381.2021.02.22.11.19.49; Mon, 22 Feb 2021 11:20:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233199AbhBVTSY (ORCPT + 99 others); Mon, 22 Feb 2021 14:18:24 -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 ;-/