Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp137169ybg; Mon, 27 Jul 2020 18:09:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6rbOsfIMmMXgeTab+oADn9IInNJZKnGK3CTNZDtw23o1/qBXWCf+TWDG3x3DJSi9v+9/o X-Received: by 2002:a05:6402:681:: with SMTP id f1mr8921939edy.361.1595898593399; Mon, 27 Jul 2020 18:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595898593; cv=none; d=google.com; s=arc-20160816; b=PAB4UbjhPvLE/VM+XqZhC8f6xdNqpPXZv1aIFZk74UPs7E6nv4A8M9Qq5V1EKsku0E LfFSpXqo3DscBbwFO+lAS8oUFv1FbjAD5r4u1x7ibK4c931rrAE5DQ8d7FhCePGVzpQQ BWSc49LH0R8a1jTL6xRqkULDAri72kUhV+pATrLZ0nk2CzC5iOJ6MTVvfCOyGxGHYPnW 1zu5TSaOSS35xWWgLLyQZRQUsERr+O4CNDBcrVhhlYtujAluY/T9KQETiCiSz13YDnFN 1MeMU8dnBzG3PYiIcUfGZ/CWHT21c7RlYx7bum+PhF6PLDhTFpfL1D2fuhL8ufcjxp9h p5cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=98n8eb2qIps+xKIgrPvAnY4c4IhE7PTa2MID3WokdRY=; b=t3SVZRvmPcjJjmJLpfhUXAssFCdXcmxYNf1zkZj3i+DMGbxM2fZwrcxOVLOcrjBhPD 9vir2DSZNXurUr1I+mulsyc1zyHUW+mEvgxE+tg1tap30eHFWhtPMIwaWTc9EUSVpe4f 74hOKM4V7r5FNYO1p1nebuzW8OcGLtWe1wS1C2nl3czm9p+y784DE9mRzBiL1CFO8MDE xLPb9+RDNrBnh+GI7kZM4AoEhI6h6fmV8C+Fum2w+dtW4GLjmdsJQDkBhEjeo7JLis9R ENhmKJXn/ALvEY0Hbmx06AxJfeWBeMkIz3koW2Sy7wUh9k1vDf7Q1Z+j1dChX6UNiV3h m2sw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz19si7225010ejb.34.2020.07.27.18.09.16; Mon, 27 Jul 2020 18:09:53 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726194AbgG1BIe (ORCPT + 99 others); Mon, 27 Jul 2020 21:08:34 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:38362 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726139AbgG1BId (ORCPT ); Mon, 27 Jul 2020 21:08:33 -0400 X-IronPort-AV: E=Sophos;i="5.75,404,1589212800"; d="scan'208";a="96961203" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 28 Jul 2020 09:08:31 +0800 Received: from G08CNEXMBPEKD06.g08.fujitsu.local (unknown [10.167.33.206]) by cn.fujitsu.com (Postfix) with ESMTP id 723C04CE506E; Tue, 28 Jul 2020 09:08:29 +0800 (CST) Received: from [10.167.220.69] (10.167.220.69) by G08CNEXMBPEKD06.g08.fujitsu.local (10.167.33.206) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 28 Jul 2020 09:08:26 +0800 Message-ID: <5F1F7A82.6020005@cn.fujitsu.com> Date: Tue, 28 Jul 2020 09:08:18 +0800 From: Xiao Yang User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.2; zh-CN; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: Eric Biggers CC: , , , Subject: Re: [PATCH] chattr/lsattr: Support dax attribute References: <20200727092901.2728-1-yangx.jy@cn.fujitsu.com> <20200727153748.GA1138@sol.localdomain> In-Reply-To: <20200727153748.GA1138@sol.localdomain> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.220.69] X-ClientProxiedBy: G08CNEXCHPEKD06.g08.fujitsu.local (10.167.33.205) To G08CNEXMBPEKD06.g08.fujitsu.local (10.167.33.206) X-yoursite-MailScanner-ID: 723C04CE506E.ABD08 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com X-Spam-Status: No Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi Eric, Thanks for your review. On 2020/7/27 23:37, Eric Biggers wrote: > On Mon, Jul 27, 2020 at 05:29:01PM +0800, Xiao Yang wrote: >> Use the letter 'x' to set/get dax attribute on a directory/file. >> >> Signed-off-by: Xiao Yang >> --- >> lib/e2p/pf.c | 1 + >> lib/ext2fs/ext2_fs.h | 1 + >> misc/chattr.1.in | 10 ++++++++-- >> misc/chattr.c | 3 ++- >> 4 files changed, 12 insertions(+), 3 deletions(-) >> >> diff --git a/lib/e2p/pf.c b/lib/e2p/pf.c >> index 0c6998c4..e59cccff 100644 >> --- a/lib/e2p/pf.c >> +++ b/lib/e2p/pf.c >> @@ -44,6 +44,7 @@ static struct flags_name flags_array[] = { >> { EXT2_TOPDIR_FL, "T", "Top_of_Directory_Hierarchies" }, >> { EXT4_EXTENTS_FL, "e", "Extents" }, >> { FS_NOCOW_FL, "C", "No_COW" }, >> + { FS_DAX_FL, "x", "Dax" }, >> { EXT4_CASEFOLD_FL, "F", "Casefold" }, >> { EXT4_INLINE_DATA_FL, "N", "Inline_Data" }, >> { EXT4_PROJINHERIT_FL, "P", "Project_Hierarchy" }, >> diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h >> index 6c20ea77..b5e2e42a 100644 >> --- a/lib/ext2fs/ext2_fs.h >> +++ b/lib/ext2fs/ext2_fs.h >> @@ -334,6 +334,7 @@ struct ext2_dx_tail { >> #define EXT4_EA_INODE_FL 0x00200000 /* Inode used for large EA */ >> /* EXT4_EOFBLOCKS_FL 0x00400000 was here */ >> #define FS_NOCOW_FL 0x00800000 /* Do not cow file */ >> +#define FS_DAX_FL 0x02000000 /* Inode is DAX */ >> #define EXT4_SNAPFILE_FL 0x01000000 /* Inode is a snapshot */ >> #define EXT4_SNAPFILE_DELETED_FL 0x04000000 /* Snapshot is being deleted */ >> #define EXT4_SNAPFILE_SHRUNK_FL 0x08000000 /* Snapshot shrink has completed */ > How about putting the values in order? Sure, I will put the values in order. >> diff --git a/misc/chattr.1.in b/misc/chattr.1.in >> index ff2fcf00..b27c8e1f 100644 >> --- a/misc/chattr.1.in >> +++ b/misc/chattr.1.in >> @@ -23,7 +23,7 @@ chattr \- change file attributes on a Linux file system >> .B chattr >> changes the file attributes on a Linux file system. >> .PP >> -The format of a symbolic mode is +-=[aAcCdDeFijPsStTu]. >> +The format of a symbolic mode is +-=[aAcCdDeFijPsStTux]. >> .PP >> The operator '+' causes the selected attributes to be added to the >> existing attributes of the files; '-' causes them to be removed; and '=' >> @@ -45,7 +45,8 @@ secure deletion (s), >> synchronous updates (S), >> no tail-merging (t), >> top of directory hierarchy (T), >> -and undeletable (u). >> +undeletable (u), >> +and direct access for files (x). > There's another part that needs to be updated to add "x": > > "The letters 'aAcCdDeFijPsStTu' select the new attributes for the files:" Good catch. :-) Thanks, Xiao Yang > > . >