Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp36875pxb; Tue, 23 Feb 2021 17:15:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXskxpRkiSHCva+N4Vsqvv/XxezvQRtKxztaBEi9szO5aiPhGCPlyAArkJzwzuWsG2pZuX X-Received: by 2002:a17:906:3285:: with SMTP id 5mr29539334ejw.356.1614129313999; Tue, 23 Feb 2021 17:15:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614129313; cv=none; d=google.com; s=arc-20160816; b=Al+fX9rIT7kch6FYPNtMCwRsinmwn0nRBpF/nkrBYD9U6FfRdVhdQXeWfaeh4ANzSQ nqfURJ3lh5yjyyX7ESe5AANPrQWabD74mS7Ev2bDRJa9yaQ3/JpU3XRZaD189hmvYnXx ApSSMh4p7UnyveIHVuFtXD1+M4C5PJtOKfB0tz9WdnKzdiAa19NvGC0ADvq9B/7eyi9/ G6TU6b2pbIXNsE2/a/I8QSQkrXVhXZiQVZEqDeTNmLaFPr76hO6vU9Zvej2nSF8ZSOeJ ZoTCCiK9BrCAeMBpfmPnNuuSN5zNbwKcySyNHiu5w1aQzdQgmQSDwTM9sTYv4m3WxWpg 9A6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ZGQfF4oN/V9HxzfESHwHorZf8VzTu9XUqX/CkzTvi60=; b=BiG1t7tMIzrbel/srO2SYZ5+JanOUQJVuWN4DlYrsKKmZmitr3ftEMJwKpf3jzNcst PtE5u3PYBUPIKxi59Mv+t5+Qa+FaNGZ7AX3Th7W5TL99rkamk1jpnrVRMQjO3dJ5bLln XZX5IHu2RkzVV1HFYpVNh4VjPf3awtonCoD5xI9QAsoi7XyjcbbEKxK3EtxLtOVwmJ89 0r/RTwLSDtFSB6FcjIxaiXrzq3t1JtzrW8TA4RdYK6rdzjcR6UN4UWytVXGXtf66oGzv JG2FmyH5tc04mupiL28Pk4FLeJQw263724mNfr79CDVbYDw9qGiQysIOLyBNvY9KUYvs KYPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pYy+nzg2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg28si120482edb.249.2021.02.23.17.14.23; Tue, 23 Feb 2021 17:15:13 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pYy+nzg2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233787AbhBXBHz (ORCPT + 99 others); Tue, 23 Feb 2021 20:07:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:32782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234383AbhBXAoN (ORCPT ); Tue, 23 Feb 2021 19:44:13 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B9ED060C3E; Wed, 24 Feb 2021 00:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614127230; bh=B9KRZo0voEyKZK+SLYtkKhTZe66u0VoBC9SE8Szq7Sk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pYy+nzg2Ig72u2lWGdkgoJFChLv5LnVuqvRPOpvFCMUARd9XFO3m7dozQyoQVWI3w 9YLAXGshyTqkW2ltj6ckNGZtbjgpcxPlmOM0Rwrz2bNKQjgmog/ELHbAYSZCH0e+OV jlx1NH6of293Pn7BIphj+CX+TaP6iaawBBND//VGrHHEGCICuRI59ZPKqFNVXiLy/m +qxNYjWzgeMfUXXQImQ/yj48uZ/TfCIvDzBVPd1hgJtbGdkIhFqIK/KGo4p2NvTPZH e9PaOpSxwPUaSGWveXe9Zf+ZCRFBPSPdkxmp1nyJw9tBvMg9MHUHCb0Mknza3rDbYs syh6RRvuE8Jng== Date: Tue, 23 Feb 2021 16:40:26 -0800 From: Jakub Kicinski To: Al Viro Cc: netdev@vger.kernel.org, Denis Kirjanov , Christoph Hellwig , LKML , linux-fsdevel , Cong Wang Subject: Re: [PATCHSET] making unix_bind() undo mknod on failure Message-ID: <20210223164026.01b56449@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: References: <20210129131855.GA2346744@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 22 Feb 2021 19:06:00 +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. Dave is out this week, but this looks good to me. You said "please review" - I'm assuming you'll send these to Linus yourself, so: Acked-by: Jakub Kicinski