From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f74.google.com (mail-wr1-f74.google.com [209.85.221.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 8E1D9421A0D for ; Tue, 20 Jan 2026 12:38:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768912731; cv=none; b=o1HCqo/xDLGeIJrf52iBZ9gDxxNcBdMyiho365VrR8+KddtT3VJw0JqNiNWSiV2wuNeqmStbyD/styY68aEHjRtWYkNY4fl4OU1oIxRxhBoohi/IfvmZpBwcCYy5vFWPUEj/J75kwosP4oXKOgNVQUKhVNZSjnGnZGOnkpy4cuE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768912731; c=relaxed/simple; bh=PwApb91RxQIKd1rzfJ2xAleSXJcHnAXezOdyfHCU/8k=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Jw5L+5OiEQrznt2ShRBxcOlRh0Ip56dUarhB6w5SwqbxStdnWizHi0hVHNIRtXdiB31amtnrOOINBtv8x2t7Q3fp7QiEXcs7ST6OYnBcWLYgXA3IkMpMXWaHkhGpJE1EJdsE2Le7+L5U5cr3rPCcaNObzhEheZxkx/aXCam6IIM= 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=2umk9AWi; arc=none smtp.client-ip=209.85.221.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="2umk9AWi" Received: by mail-wr1-f74.google.com with SMTP id ffacd0b85a97d-430fb8d41acso3082547f8f.1 for ; Tue, 20 Jan 2026 04:38:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1768912728; x=1769517528; 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=v5uBS89EprhTXTMtWy33Byzr1DNzGriqxZMXGCf0cIw=; b=2umk9AWiz9orTQh9fEnzb0/lEKqJ1LAOeotkj6jpFrnlJBuYCX/3SstEFf5fY+njwX iaYtfRFkhx0r/9VonYrK08tW5yfXMSDaEs/BWm7Yg5irVgrc/TzszgVQCdID/DxRu79b n/swbGsrAA142gRzDZXbjPopqRC1j81ry8PRixoFL5kM+vEIPambFVj4T4wpyH9iEoAn +mnh/TuW3Duo3UVER0vn4CCj8x/Qg0NoB+TtYw0ebfCiaOhsih8krX6P18R7IL0fAfnZ 7lMHoBION3CvFBFdMnC1biBllH0SaCi8cvn7mTqEV2Ax3s8+li0W/ioQutbY5jCT/tKR ZxHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768912728; x=1769517528; 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=v5uBS89EprhTXTMtWy33Byzr1DNzGriqxZMXGCf0cIw=; b=CA6uWqqtK6OnKqM9dT5rhJHjkig7mOnXIz+78ALz8N1ZXHQ7U2yAtAYQjTwzFOwOCg z7Quu+5u5QkCb0NoQIXZZFg+n08OTrQxuFDlUTFYvASKdd2bzGaiUtdH7MUMQXJilf8c 2C7zch3G4x2+0d5PAd3GeuwAc1uRq1F+C61e3n+ngCJH5OGk7vc9k7RGhx5O1NzFfD9G +MR74XN0N4G3tBXYI1BEUGZbKlwfyI41XjS//NniA9EPPO+9nIlm7TMUOAwKfOKM0rnf iw4IzevIEvid5FLzbRpynp4N4FwJIpsIKjQ3h2Kaf6Jc26wLY43Vp4+Uw81YYaA9QMEN SUCw== X-Forwarded-Encrypted: i=1; AJvYcCVDak5opqvpYV4bUR0TWLLHMhrkZmmZa9EKhdGOa3IOJ9v4to2KkssDjHsZlmXVzc9K5E7uQVYBj3fxPPPS@vger.kernel.org X-Gm-Message-State: AOJu0YzlPXNpMFdfbd9mLWF8FM8mH3UfDgPD08nfJA5s2GdQNXsUObaD LJ8XGs5hrfdcQt8LPGcsho/2O3K0Y5hg4XbbyAyvQurfaSMOsHhdf1nb6pozncPzS9KNZBZXQwl onwVedgvkfs2N3r6iHw== X-Received: from wrp4.prod.google.com ([2002:a05:6000:41e4:b0:435:948f:2ec0]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:2885:b0:430:fd84:317a with SMTP id ffacd0b85a97d-4356a051d68mr21671610f8f.38.1768912728086; Tue, 20 Jan 2026 04:38:48 -0800 (PST) Date: Tue, 20 Jan 2026 12:38:47 +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 Reviewed-by: Alice Ryhl