Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp23819rdb; Sun, 28 Jan 2024 11:38:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IEsoKfFLCG4JTakQgn+CzKT7iEqJTtlNN+EsFaQlTwmAso28Wl6dgAeSHQ45SrabONHlILG X-Received: by 2002:a05:620a:2098:b0:783:ce47:86bd with SMTP id e24-20020a05620a209800b00783ce4786bdmr4291472qka.81.1706470705150; Sun, 28 Jan 2024 11:38:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706470705; cv=pass; d=google.com; s=arc-20160816; b=udtgi7fqkCJ/DYIiI2DwFloXTMj166JcoQ4SusYa/7qDdIAP5pMQ8WWwAm1WWxSV9y wgopr0cWEbZctb7Czkiajxhbvd4jSqVlnglB1Ac2FF8mgBaib7APJIpmoY/NQuYRYYwn FUuwkY4PutFzrL82BoWPii8brLT/Nj4cRDLhENLylX+K6Eqruf/+u8NxkkxhlveKSlSw gKl2/MeTbxlIeeKeefpNpk8+GTUU2f+KXgRa1yiqndfRmZWrhjvvCB8z1MEI63U7ha66 I29D3wadFtvlXFbT7JZRAzGZSmF6k6O7Csf1+yQJgZaNgtBEi2VgLB1LMkqkxAsmFoPF 168w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=/XSVKc6w+A+XmgwvfzwCcqpDMcWCgObA9/bvZvw48qU=; fh=uqvSQzI9/8tfOBejfKYBzV9BcYjxeY5Kq8bk0PgZCPI=; b=U+ZmDreJU9YEuiHhllHBj78VZUMfar26doQoK+zsQnUC4/zbwIXMFGab8wEesdxWoM BaIXfJko56K8h+1AytKaNQQEOt5GKhF2IER5OHvPUfel4+kS5bZ1h5yEAigpQZJqA8Ub m+4QNPQrPHhdUtxAgtWJT5/przWqiftsBBQOxPbFp491laTmcry8sgVDKeeSV23Br32D agBXWQtinpgaic3oN5ACvCpOgjFALVGWrtYLuovfqQNyK9uY9yhoAijyw6M3GG0hg9BN HeNbp4cqY/98iEARTa5VtSiO+u2M2Hs2iTDeJlq+tWaqDRWg59aLSYdDIuomcT5zInDz XA+Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=lB5VtcFy; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-41912-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41912-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l10-20020a37f50a000000b007833cd10907si5960779qkk.625.2024.01.28.11.38.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 11:38:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41912-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=lB5VtcFy; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-41912-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41912-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E1B691C21011 for ; Sun, 28 Jan 2024 19:38:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC46F37166; Sun, 28 Jan 2024 19:38:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="lB5VtcFy" Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9289831A98 for ; Sun, 28 Jan 2024 19:38:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706470690; cv=none; b=EaBloLy69LE05WCTVfFX6iDjDpeJfaOzQ/3alApVt0WIOItm0SfnMw7z81QQ6VonOjSFNuGU0ZE+RTQbKWywdfckh1Np6IdxZewGfR6AukgGP9heiE5ePId68wTToOfn8dlfXYO/QkjlTRm4JYM/8aZ4U9K4U2lg38wzkpPBZig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706470690; c=relaxed/simple; bh=fX9kLBzWyB/CMt5krU9aRo2/9LWbOP//s9WREBYu03U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RBkC2f3Mnsb7hfFC4zD7rW/NsqAu18JIDY+e+IiSvg30CR7Ar+t/nwZZ5ieuRhyTzDmXZtR9Q+XBQq4nrF5yI7P7PIcfyyz0pNcuO+2yIF5Zfxc/GpQ4Te1opeNY9pn0avHv6PDinW6wEc1ZDl1zfQlwqRrdFeG6rsQewTQwyWY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=lB5VtcFy; arc=none smtp.client-ip=95.215.58.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Sun, 28 Jan 2024 14:38:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1706470686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/XSVKc6w+A+XmgwvfzwCcqpDMcWCgObA9/bvZvw48qU=; b=lB5VtcFy7aF6cpkgma6yez8sMpMAz/mpV/YD1xJVy1FuCar5hxpJTFi3bXxiuHfPR8T3mx 7OqKn9T7SJlh2lOz/oCvxWjLIIlfuiaupGHKe3sIwWauc3J+ctzrPr+EvTIOTQ/AFWHEB7 4LKC5jHFfK6Wrvnby/iaqtNonDci1xc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Kuniyuki Iwashima Cc: boqun.feng@gmail.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, peterz@infradead.org Subject: Re: [PATCH 4/4] af_unix: convert to lock_cmp_fn Message-ID: References: <20240127020833.487907-5-kent.overstreet@linux.dev> <20240128082838.3961-1-kuniyu@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240128082838.3961-1-kuniyu@amazon.com> X-Migadu-Flow: FLOW_OUT On Sun, Jan 28, 2024 at 12:28:38AM -0800, Kuniyuki Iwashima wrote: > From: Kent Overstreet > Date: Fri, 26 Jan 2024 21:08:31 -0500 > > Kill > > - unix_state_lock_nested > > - _nested usage for net->unx.table.locks[]. > > > > replace both with lock_set_cmp_fn_ptr_order(&u->lock). > > > > The lock ordering in sk_diag_dump_icons() looks suspicious; this may > > turn up a real issue. > > Yes, you cannot use lock_cmp_fn() for unix_state_lock_nested(). > > The lock order in sk_diag_dump_icons() is > > listening socket -> child socket in the listener's queue > > , and the inverse order never happens. ptr comparison does not make > sense in this case, and lockdep will complain about false positive. Is that a real lock ordering? Is this parent -> child relationship well defined? If it is, we should be able to write a lock_cmp_fn for it, as long as it's not some handwavy "this will never happen but _nested won't check for it" like I saw elsewhere in the net code... :)