Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp229056pxu; Tue, 1 Dec 2020 09:47:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqAh0OEiyjRlgrgtT3TIhU7dKVxQYHcxHMfUsqZh5PUdq/sF8GXiTImgAtwzfAui0DXjPs X-Received: by 2002:a50:b021:: with SMTP id i30mr4289651edd.270.1606844871958; Tue, 01 Dec 2020 09:47:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606844871; cv=none; d=google.com; s=arc-20160816; b=RRaAhFzrJ56vx/MJnfCse8eGJOnmsviVZ9nibYRbUFkRyVXlGW77jf2yVnRsUlrFUo NplakygXtZuPpn7uAqgVdmZNEN4HqwWB1tIijR5VkkQMMSyNJ551qb/zMEStp7X0Nt7U 8V+HmVvUXC1PMMaH1jedPhW3S80rynH9+izE+4oHD6eBP/DlxYzeESwwLczx2W2igFwH Z8Hv3CXDnWCvRH/mSRCHMl2NsWF6czrUbSY3oIYDzd04BCYzDZNcD7LypLw+tLGjfhWk G9MeJeHSR06j83r/KlkyXZnHGdjEca52SIcZ58VX7s/XPa9UrDl78IahYdELZf5JXm0Y 3RJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=tcQqw8FNohQsgX6eE6NAJbjUyNM6Eexh/ekG8LwxPCU=; b=Jr3C8i4zuVG4LsUnN77/VbDZzknmdGGEweFDX9J1P0fdukSnHOrFufi/YZb6wSXVUX yGQb4wIPKisKNC87rxNZXJK3NFhjN8nsCqxoFV0n6X6Cm/LpRfS1O6RV3f2p8vhCYPBM 1BlZglHdDfN51r794yJGGP4w6G0Uq/JG5gzWsTVQGIAZo1yXurpZ1yrT0G1LCRAIX0ea CxQLLiKwMyh1iJQW1MrTYAREwZQG/IDh0kshQiLO7O1IHOA4b3nbqSjavQzBaSfGgYor vKh89t76Wm/bNti93+pSM1id4s1kjWHi4jk76gH8Dkdd0fJC6XOAe7wwsVqtNNuV61YO he+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GBuHmMRY; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si404960eje.119.2020.12.01.09.47.27; Tue, 01 Dec 2020 09:47:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-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=@redhat.com header.s=mimecast20190719 header.b=GBuHmMRY; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404134AbgLARqD (ORCPT + 99 others); Tue, 1 Dec 2020 12:46:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:49585 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404094AbgLARqC (ORCPT ); Tue, 1 Dec 2020 12:46:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606844676; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tcQqw8FNohQsgX6eE6NAJbjUyNM6Eexh/ekG8LwxPCU=; b=GBuHmMRYlEDPGs7IFIYsuxuc2FdrZBlL7iWYhq4zhB8gIMm4T/5VpESQHC0f3bWt2mPKkj oRlhnvLK+ddGznbQwUXwjRdkUKDmALjTOHXZZ2Q+u2hZLQKmk0QrfZ0FJhUdb7bzlneuCv mY0no+ZDeUs/Vs+u6HmUuQG0I8C+od4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-470-nOzvlp74N7KyPfj8Q-hc2w-1; Tue, 01 Dec 2020 12:44:35 -0500 X-MC-Unique: nOzvlp74N7KyPfj8Q-hc2w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 955AFE743; Tue, 1 Dec 2020 17:44:33 +0000 (UTC) Received: from liberator.sandeen.net (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9ED6D5D6AD; Tue, 1 Dec 2020 17:44:32 +0000 (UTC) Subject: Re: [PATCH 1/2] uapi: fix statx attribute value overlap for DAX & MOUNT_ROOT To: "Darrick J. Wong" Cc: torvalds@linux-foundation.org, Miklos Szeredi , Ira Weiny , David Howells , linux-fsdevel@vger.kernel.org, linux-man@vger.kernel.org, linux-kernel@vger.kernel.org, xfs , linux-ext4@vger.kernel.org, Xiaoli Feng References: <7027520f-7c79-087e-1d00-743bdefa1a1e@redhat.com> <20201201173213.GH143045@magnolia> From: Eric Sandeen Message-ID: <242fce05-90ed-2d2a-36f9-3c8432d57cbc@redhat.com> Date: Tue, 1 Dec 2020 11:44:32 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20201201173213.GH143045@magnolia> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 12/1/20 11:32 AM, Darrick J. Wong wrote: > On Tue, Dec 01, 2020 at 10:57:11AM -0600, Eric Sandeen wrote: >> STATX_ATTR_MOUNT_ROOT and STATX_ATTR_DAX got merged with the same value, >> so one of them needs fixing. Move STATX_ATTR_DAX. >> >> While we're in here, clarify the value-matching scheme for some of the >> attributes, and explain why the value for DAX does not match. >> >> Signed-off-by: Eric Sandeen >> --- >> include/uapi/linux/stat.h | 7 ++++--- >> 1 file changed, 4 insertions(+), 3 deletions(-) >> >> diff --git a/include/uapi/linux/stat.h b/include/uapi/linux/stat.h >> index 82cc58fe9368..9ad19eb9bbbf 100644 >> --- a/include/uapi/linux/stat.h >> +++ b/include/uapi/linux/stat.h >> @@ -171,9 +171,10 @@ struct statx { >> * be of use to ordinary userspace programs such as GUIs or ls rather than >> * specialised tools. >> * >> - * Note that the flags marked [I] correspond to generic FS_IOC_FLAGS >> + * Note that the flags marked [I] correspond to the FS_IOC_SETFLAGS flags >> * semantically. Where possible, the numerical value is picked to correspond >> - * also. >> + * also. Note that the DAX attribute indicates that the inode is currently >> + * DAX-enabled, not simply that the per-inode flag has been set. > > I don't really like using "DAX-enabled" to define "DAX attribute". How > about cribbing from the statx manpage? > > "Note that the DAX attribute indicates that the file is in the CPU > direct access state. It does not correspond to the per-inode flag that > some filesystems support." Sure. Consistency and specificity is good, I'll change that. >> */ >> #define STATX_ATTR_COMPRESSED 0x00000004 /* [I] File is compressed by the fs */ >> #define STATX_ATTR_IMMUTABLE 0x00000010 /* [I] File is marked immutable */ >> @@ -183,7 +184,7 @@ struct statx { >> #define STATX_ATTR_AUTOMOUNT 0x00001000 /* Dir: Automount trigger */ >> #define STATX_ATTR_MOUNT_ROOT 0x00002000 /* Root of a mount */ >> #define STATX_ATTR_VERITY 0x00100000 /* [I] Verity protected file */ >> -#define STATX_ATTR_DAX 0x00002000 /* [I] File is DAX */ >> +#define STATX_ATTR_DAX 0x00400000 /* File is currently DAX-enabled */ > > Why not use the next bit in the series (0x200000)? Did someone already > claim it in for-next? Since it didn't match the FS_IOC_SETFLAGS flag, I was trying to pick one that seemed unlikely to ever gain a corresponding statx flag, and since 0x00400000 is "reserved for ext4" it seemed like a decent choice. But 0x200000 corresponds to FS_EA_INODE_FL/EXT4_EA_INODE_FL which is ext4-specific as well, so sure, I'll change to that. Thanks, -Eric > --D > >> >> >> #endif /* _UAPI_LINUX_STAT_H */ >> -- >> 2.17.0 >> >