From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A916C433FE for ; Wed, 6 Oct 2021 15:49:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E876A610C7 for ; Wed, 6 Oct 2021 15:49:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238668AbhJFPu6 (ORCPT ); Wed, 6 Oct 2021 11:50:58 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:53018 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239041AbhJFPux (ORCPT ); Wed, 6 Oct 2021 11:50:53 -0400 Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mY985-00AWZP-As; Wed, 06 Oct 2021 15:46:49 +0000 Date: Wed, 6 Oct 2021 15:46:49 +0000 From: Al Viro To: David Hildenbrand Cc: Matthew Wilcox , linux-mm@kvack.org, Kent Overstreet , Johannes Weiner , linux-fsdevel@vger.kernel.org Subject: Re: [RFC] pgflags_t Message-ID: References: <106400c5-d3f2-e858-186a-82f9b517917b@redhat.com> <21ce511e-7cde-8bdb-b6c6-e1278681ebf6@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <21ce511e-7cde-8bdb-b6c6-e1278681ebf6@redhat.com> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, Oct 06, 2021 at 05:32:39PM +0200, David Hildenbrand wrote: > It feels to me like using __bitwise for access checks and then still > modifying the __bitwise fields randomly via a backdoor. But sure, if it > works, I'll be happy if we can use that. __bitwise == "can't do anything other than bitwise operations without an explicit force-cast". All there is to it. Hell, the very first use had been for things like __le32 et.al., where the primitives very much do non-bitwise accesses. They are known to be safe (== do the same thing regardless of the host endianness). Internally they contain force-casts, precisely so that the caller wouldn't need to.