From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A6C4426D14 for ; Tue, 20 Jan 2026 12:39:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768912757; cv=none; b=Mrk0uyweWNDXaAuQgQu5FMqprjOFpNz0eIFPH5KLYyNwKoUe1MORK/A9L0E47qnDWVbXe/j8bc9r6Yxo+JkD+TR0iBeqb7VxvkMRVvbMX2ZzDE+5O/zOuqbjsHJ/K3WzZ1ayBoFzIXthMj2dIBFqBVpsof01Jf7+pEWfJmA1W50= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768912757; c=relaxed/simple; bh=4hQ5wthGbRwK+tJ8j7a8ZpnaN272v9XF9TyqQHVeT7M=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=niDQp5DFYOveo+zu+U1vDhqy07mMc7cvfugedqMw/hMkk1coaWccyiehasfvrjrQOt34V1nXevEt2ksatlmgo0bWQ3rXviSPRQYIc99BNhsTAuBza5OpDqBZlCoI3XS7U/3hlJrJUOey2vCyRpAJmuo5+qE8h97UJPoJ9SCCC1Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=SINlgYNR; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="SINlgYNR" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-4803b4e3b9eso9037295e9.3 for ; Tue, 20 Jan 2026 04:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1768912754; x=1769517554; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=aC20Vi3ua6RNxinQI5h1askXn9iFU0ocrDNDebQDeNI=; b=SINlgYNR2tMUaMhpKlTrBu24v2h7sDtC19jXJFpl3psVbL8Kzxm6+vO/x7W0/z4HxD eaB7ohKK8yTpqOjVFmNqyfzWZ9BL9JtcHuHJHx2R2yOilpBTpQL2XApTO4d31ptnVMN3 E3lWP/DJZEVWV34g5BPZWHPHPOWWzEtEU0n+kj5ED+FAIPyhEAUMFVK0o4td/w2Iszne LJwa/XtQwmsiXyb6bp9fZzSUQiKaMq7RM74YsdVaP3GXFYf8Jau60ucY3LGE49C7iGjI wyKeZH6S36RzTf8NVLSAKaN8MDmupPMra+Tt51T42NZvAvynocg6Dz+VY3Jt5RGvjOIT zv+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768912754; x=1769517554; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aC20Vi3ua6RNxinQI5h1askXn9iFU0ocrDNDebQDeNI=; b=tv3IM2P+aJ7HJzsBeah8BrSf+KamepMXpPAPMgzyzbIHwxEAlZs+ydi9cCaGfqFc9t 2DTpIhMPmHacD3+4A+jManvlgl0vJbiKxvSYbs2USTmkh58uBxpwSTMp7XpgoQ1vYQcz PWhqO7M1mMxSb/GMv67sRlnQA7BiUfaObFOVjUppzhD5IofXpsaOoceAJZJRWIIiNXlG VzjUSxZTO6+knbveYQvEL7/40TyfYIkM6hDAH7TxPOWMFU2kG0DQlH6clwexUUULOEOC 9zfNNaCVOn+RxTYa/8vPNKGB2CaqZvL4TsNbcQXWYqy3ZXrmWzr7YG1pjUTwXVvH8hru 5c9g== X-Forwarded-Encrypted: i=1; AJvYcCVcAn1bZIp+vnTdKjYYd/lbyfBnpgvLHnsIb3M0w3WsC/8ItsOafc2OrXWDHbC8vQR0fDolpHywVvGFDjoq@vger.kernel.org X-Gm-Message-State: AOJu0Yw1YDhpGLWVZ3WE/ftoVxP7NIruydPlNUs45rMNAWqoHSHkdJyw fJ/HlwPYxhnFjRS47nshDbrMOvbCqX+5Cr5HZKDVWGAU93zYPraVFUTb9bPoPiUb1vdsD+ZPGFP zhoKgfDY17ORc46CGIw== X-Received: from wmig10.prod.google.com ([2002:a05:600c:140a:b0:47a:9f70:c329]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:811a:b0:480:1dc6:2686 with SMTP id 5b1f17b1804b1-4801eac0cfcmr156081605e9.13.1768912754423; Tue, 20 Jan 2026 04:39:14 -0800 (PST) Date: Tue, 20 Jan 2026 12:39:13 +0000 In-Reply-To: <20260120115207.55318-2-boqun.feng@gmail.com> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260120115207.55318-1-boqun.feng@gmail.com> <20260120115207.55318-2-boqun.feng@gmail.com> Message-ID: Subject: Re: [PATCH 1/2] rust: sync: atomic: Remove bound `T: Sync` for `Atomci::from_ptr()` From: Alice Ryhl To: Boqun Feng Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-fsdevel@vger.kernel.org, kasan-dev@googlegroups.com, Will Deacon , Peter Zijlstra , Mark Rutland , Gary Guo , Miguel Ojeda , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , Elle Rhumsaa , "Paul E. McKenney" , Marco Elver , FUJITA Tomonori Content-Type: text/plain; charset="utf-8" On Tue, Jan 20, 2026 at 07:52:06PM +0800, Boqun Feng wrote: > Originally, `Atomic::from_ptr()` requires `T` being a `Sync` because I > thought having the ability to do `from_ptr()` meant multiplle > `&Atomic`s shared by different threads, which was identical (or > similar) to multiple `&T`s shared by different threads. Hence `T` was > required to be `Sync`. However this is not true, since `&Atomic` is > not the same at `&T`. Moreover, having this bound makes `Atomic::<*mut > T>::from_ptr()` impossible, which is definitely not intended. Therefore > remove the `T: Sync` bound. > > Fixes: 29c32c405e53 ("rust: sync: atomic: Add generic atomics") > Signed-off-by: Boqun Feng there is a typo in patch title