Message ID | 20230407141710.113882-8-jefflexu@linux.alibaba.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp333703vqo; Fri, 7 Apr 2023 07:44:14 -0700 (PDT) X-Google-Smtp-Source: AKy350a55Sr1hN73xGP4AzRR6XFMhqYTVgVBWb9CgnkbjVx/eb0UxLQnkJq9FVOqdda6SkyV4U8Y X-Received: by 2002:a17:906:e297:b0:86f:b99c:ac8d with SMTP id gg23-20020a170906e29700b0086fb99cac8dmr2483459ejb.44.1680878654599; Fri, 07 Apr 2023 07:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680878654; cv=none; d=google.com; s=arc-20160816; b=k9RrtXF3VMIhlGrZpdJUJInN5TblwV6B+cXMT6qHAFsszJl1qzcoXSSnoxBqSpUS3U EbqVEhTMjwnA3B6MgBDWjmDW3MCJZEPsBcmLu1ZUEwDCme5HvrPKsfceN+2NMitJIu4a KLyXwyDaqtohA6GugAraPX8C+d23MqjxZamTij/FGTLDU7OvJ9vmgqkGHUXbDSv7cjKz K2zJjo4vZc/pzSrMiEB3j9cJGlVvjroxR8aerR3D+qBtJH0vkLwLJh5Ci74szPJS/sr+ h3werwgIhvu5PkWsGk3Xsm1Wm7qyhyrT5h/blEMIkm+wp4EphYOjOw32W6lBzyicIEuI 5/tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qiJ0TKyg3QM9NJDMpb6nqTuJHUM74LevTW8D4jS2ijU=; b=wSqrKrYPwjEje4TMfnu+dokZo5wd23xa0Nq9weXza7yk9KBSLNUeaZ7QSHrG3bivqW Qd8m+SXZ8gHgsMNoy0uJFPjtbh7tDI8Uno6Iis9C54FIfZ/c1Nys/SkcbmKltcRdYsec sSFQEhmzy0oi8kfC8BuPCdiI8tCBBQ4BGSjhDB1mXi55pj71sSi2HRd7U8B8RbkxIB1i 4DtshYNNEGVbVjRWpRlxB8j8FUq7cjbxyXfW5+2fgDXXEJfgeCKaGgWT52gT5q6V9wQD 83bWjvBNiY5R+dVcuo3OWVvdQV5UKFWTz4/9sUhgzU+w63Ebfu4E6hRa2e/IDAgsYwwR VROQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ck10-20020a170906c44a00b0092d5457516asi3243229ejb.589.2023.04.07.07.43.51; Fri, 07 Apr 2023 07:44:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240543AbjDGORh (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Fri, 7 Apr 2023 10:17:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240100AbjDGORW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 7 Apr 2023 10:17:22 -0400 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADB9176AA for <linux-kernel@vger.kernel.org>; Fri, 7 Apr 2023 07:17:21 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R231e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0VfX4iF._1680877038; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VfX4iF._1680877038) by smtp.aliyun-inc.com; Fri, 07 Apr 2023 22:17:19 +0800 From: Jingbo Xu <jefflexu@linux.alibaba.com> To: xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, linux-erofs@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 7/7] erofs: enable long extended attribute name prefixes Date: Fri, 7 Apr 2023 22:17:10 +0800 Message-Id: <20230407141710.113882-8-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20230407141710.113882-1-jefflexu@linux.alibaba.com> References: <20230407141710.113882-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.0 required=5.0 tests=ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762529016264187339?= X-GMAIL-MSGID: =?utf-8?q?1762529016264187339?= |
Series |
erofs: introduce long xattr name prefixes feature
|
|
Commit Message
Jingbo Xu
April 7, 2023, 2:17 p.m. UTC
Let's enable long xattr name prefix feature. Old kernels will just
ignore / skip such extended attributes so that in case you don't want
to mount such images. Add another incompatible feature as an option
for this.
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
---
fs/erofs/erofs_fs.h | 4 +++-
fs/erofs/internal.h | 1 +
fs/erofs/super.c | 8 ++++++++
3 files changed, 12 insertions(+), 1 deletion(-)
Comments
Hi Jingbo, kernel test robot noticed the following build errors: [auto build test ERROR on xiang-erofs/dev-test] [also build test ERROR on xiang-erofs/dev] [cannot apply to xiang-erofs/fixes linus/master v6.3-rc5 next-20230406] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Jingbo-Xu/erofs-keep-meta-inode-into-erofs_buf/20230407-221839 base: https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git dev-test patch link: https://lore.kernel.org/r/20230407141710.113882-8-jefflexu%40linux.alibaba.com patch subject: [PATCH 7/7] erofs: enable long extended attribute name prefixes config: alpha-randconfig-r026-20230403 (https://download.01.org/0day-ci/archive/20230408/202304080101.D8cyKOoF-lkp@intel.com/config) compiler: alpha-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/8cd5bbc6f857d54388099c30c3e3a48fdb15c283 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Jingbo-Xu/erofs-keep-meta-inode-into-erofs_buf/20230407-221839 git checkout 8cd5bbc6f857d54388099c30c3e3a48fdb15c283 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=alpha olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=alpha SHELL=/bin/bash fs/erofs/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202304080101.D8cyKOoF-lkp@intel.com/ All errors (new ones prefixed by >>): fs/erofs/super.c: In function 'erofs_read_superblock': >> fs/erofs/super.c:394:12: error: 'struct erofs_sb_info' has no member named 'xattr_prefix_start' 394 | sbi->xattr_prefix_start = le32_to_cpu(dsb->xattr_prefix_start); | ^~ >> fs/erofs/super.c:395:12: error: 'struct erofs_sb_info' has no member named 'xattr_prefix_count' 395 | sbi->xattr_prefix_count = dsb->xattr_prefix_count; | ^~ vim +394 fs/erofs/super.c 333 334 static int erofs_read_superblock(struct super_block *sb) 335 { 336 struct erofs_sb_info *sbi; 337 struct erofs_buf buf = __EROFS_BUF_INITIALIZER; 338 struct erofs_super_block *dsb; 339 void *data; 340 int ret; 341 342 data = erofs_read_metabuf(&buf, sb, 0, EROFS_KMAP); 343 if (IS_ERR(data)) { 344 erofs_err(sb, "cannot read erofs superblock"); 345 return PTR_ERR(data); 346 } 347 348 sbi = EROFS_SB(sb); 349 dsb = (struct erofs_super_block *)(data + EROFS_SUPER_OFFSET); 350 351 ret = -EINVAL; 352 if (le32_to_cpu(dsb->magic) != EROFS_SUPER_MAGIC_V1) { 353 erofs_err(sb, "cannot find valid erofs superblock"); 354 goto out; 355 } 356 357 sbi->blkszbits = dsb->blkszbits; 358 if (sbi->blkszbits < 9 || sbi->blkszbits > PAGE_SHIFT) { 359 erofs_err(sb, "blkszbits %u isn't supported", sbi->blkszbits); 360 goto out; 361 } 362 if (dsb->dirblkbits) { 363 erofs_err(sb, "dirblkbits %u isn't supported", dsb->dirblkbits); 364 goto out; 365 } 366 367 sbi->feature_compat = le32_to_cpu(dsb->feature_compat); 368 if (erofs_sb_has_sb_chksum(sbi)) { 369 ret = erofs_superblock_csum_verify(sb, data); 370 if (ret) 371 goto out; 372 } 373 374 ret = -EINVAL; 375 if (!check_layout_compatibility(sb, dsb)) 376 goto out; 377 378 sbi->sb_size = 128 + dsb->sb_extslots * EROFS_SB_EXTSLOT_SIZE; 379 if (sbi->sb_size > PAGE_SIZE - EROFS_SUPER_OFFSET) { 380 erofs_err(sb, "invalid sb_extslots %u (more than a fs block)", 381 sbi->sb_size); 382 goto out; 383 } 384 sbi->primarydevice_blocks = le32_to_cpu(dsb->blocks); 385 sbi->meta_blkaddr = le32_to_cpu(dsb->meta_blkaddr); 386 #ifdef CONFIG_EROFS_FS_XATTR 387 sbi->xattr_blkaddr = le32_to_cpu(dsb->xattr_blkaddr); 388 #endif 389 sbi->islotbits = ilog2(sizeof(struct erofs_inode_compact)); 390 sbi->root_nid = le16_to_cpu(dsb->root_nid); 391 sbi->packed_nid = le64_to_cpu(dsb->packed_nid); 392 sbi->inos = le64_to_cpu(dsb->inos); 393 > 394 sbi->xattr_prefix_start = le32_to_cpu(dsb->xattr_prefix_start); > 395 sbi->xattr_prefix_count = dsb->xattr_prefix_count; 396 397 sbi->build_time = le64_to_cpu(dsb->build_time); 398 sbi->build_time_nsec = le32_to_cpu(dsb->build_time_nsec); 399 400 memcpy(&sb->s_uuid, dsb->uuid, sizeof(dsb->uuid)); 401 402 ret = strscpy(sbi->volume_name, dsb->volume_name, 403 sizeof(dsb->volume_name)); 404 if (ret < 0) { /* -E2BIG */ 405 erofs_err(sb, "bad volume name without NIL terminator"); 406 ret = -EFSCORRUPTED; 407 goto out; 408 } 409 410 /* parse on-disk compression configurations */ 411 if (erofs_sb_has_compr_cfgs(sbi)) 412 ret = erofs_load_compr_cfgs(sb, dsb); 413 else 414 ret = z_erofs_load_lz4_config(sb, dsb, NULL, 0); 415 if (ret < 0) 416 goto out; 417 418 /* handle multiple devices */ 419 ret = erofs_scan_devices(sb, dsb); 420 421 if (erofs_sb_has_ztailpacking(sbi)) 422 erofs_info(sb, "EXPERIMENTAL compressed inline data feature in use. Use at your own risk!"); 423 if (erofs_is_fscache_mode(sb)) 424 erofs_info(sb, "EXPERIMENTAL fscache-based on-demand read feature in use. Use at your own risk!"); 425 if (erofs_sb_has_fragments(sbi)) 426 erofs_info(sb, "EXPERIMENTAL compressed fragments feature in use. Use at your own risk!"); 427 if (erofs_sb_has_dedupe(sbi)) 428 erofs_info(sb, "EXPERIMENTAL global deduplication feature in use. Use at your own risk!"); 429 out: 430 erofs_put_metabuf(&buf); 431 return ret; 432 } 433
Hi Jingbo, kernel test robot noticed the following build errors: [auto build test ERROR on xiang-erofs/dev-test] [also build test ERROR on xiang-erofs/dev] [cannot apply to xiang-erofs/fixes linus/master v6.3-rc5 next-20230406] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Jingbo-Xu/erofs-keep-meta-inode-into-erofs_buf/20230407-221839 base: https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git dev-test patch link: https://lore.kernel.org/r/20230407141710.113882-8-jefflexu%40linux.alibaba.com patch subject: [PATCH 7/7] erofs: enable long extended attribute name prefixes config: x86_64-randconfig-a005-20230403 (https://download.01.org/0day-ci/archive/20230408/202304080206.t45iYSop-lkp@intel.com/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/8cd5bbc6f857d54388099c30c3e3a48fdb15c283 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Jingbo-Xu/erofs-keep-meta-inode-into-erofs_buf/20230407-221839 git checkout 8cd5bbc6f857d54388099c30c3e3a48fdb15c283 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash fs/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> | Link: https://lore.kernel.org/oe-kbuild-all/202304080206.t45iYSop-lkp@intel.com/ All errors (new ones prefixed by >>): >> fs/erofs/super.c:394:7: error: no member named 'xattr_prefix_start' in 'struct erofs_sb_info' sbi->xattr_prefix_start = le32_to_cpu(dsb->xattr_prefix_start); ~~~ ^ >> fs/erofs/super.c:395:7: error: no member named 'xattr_prefix_count' in 'struct erofs_sb_info' sbi->xattr_prefix_count = dsb->xattr_prefix_count; ~~~ ^ 2 errors generated. vim +394 fs/erofs/super.c 333 334 static int erofs_read_superblock(struct super_block *sb) 335 { 336 struct erofs_sb_info *sbi; 337 struct erofs_buf buf = __EROFS_BUF_INITIALIZER; 338 struct erofs_super_block *dsb; 339 void *data; 340 int ret; 341 342 data = erofs_read_metabuf(&buf, sb, 0, EROFS_KMAP); 343 if (IS_ERR(data)) { 344 erofs_err(sb, "cannot read erofs superblock"); 345 return PTR_ERR(data); 346 } 347 348 sbi = EROFS_SB(sb); 349 dsb = (struct erofs_super_block *)(data + EROFS_SUPER_OFFSET); 350 351 ret = -EINVAL; 352 if (le32_to_cpu(dsb->magic) != EROFS_SUPER_MAGIC_V1) { 353 erofs_err(sb, "cannot find valid erofs superblock"); 354 goto out; 355 } 356 357 sbi->blkszbits = dsb->blkszbits; 358 if (sbi->blkszbits < 9 || sbi->blkszbits > PAGE_SHIFT) { 359 erofs_err(sb, "blkszbits %u isn't supported", sbi->blkszbits); 360 goto out; 361 } 362 if (dsb->dirblkbits) { 363 erofs_err(sb, "dirblkbits %u isn't supported", dsb->dirblkbits); 364 goto out; 365 } 366 367 sbi->feature_compat = le32_to_cpu(dsb->feature_compat); 368 if (erofs_sb_has_sb_chksum(sbi)) { 369 ret = erofs_superblock_csum_verify(sb, data); 370 if (ret) 371 goto out; 372 } 373 374 ret = -EINVAL; 375 if (!check_layout_compatibility(sb, dsb)) 376 goto out; 377 378 sbi->sb_size = 128 + dsb->sb_extslots * EROFS_SB_EXTSLOT_SIZE; 379 if (sbi->sb_size > PAGE_SIZE - EROFS_SUPER_OFFSET) { 380 erofs_err(sb, "invalid sb_extslots %u (more than a fs block)", 381 sbi->sb_size); 382 goto out; 383 } 384 sbi->primarydevice_blocks = le32_to_cpu(dsb->blocks); 385 sbi->meta_blkaddr = le32_to_cpu(dsb->meta_blkaddr); 386 #ifdef CONFIG_EROFS_FS_XATTR 387 sbi->xattr_blkaddr = le32_to_cpu(dsb->xattr_blkaddr); 388 #endif 389 sbi->islotbits = ilog2(sizeof(struct erofs_inode_compact)); 390 sbi->root_nid = le16_to_cpu(dsb->root_nid); 391 sbi->packed_nid = le64_to_cpu(dsb->packed_nid); 392 sbi->inos = le64_to_cpu(dsb->inos); 393 > 394 sbi->xattr_prefix_start = le32_to_cpu(dsb->xattr_prefix_start); > 395 sbi->xattr_prefix_count = dsb->xattr_prefix_count; 396 397 sbi->build_time = le64_to_cpu(dsb->build_time); 398 sbi->build_time_nsec = le32_to_cpu(dsb->build_time_nsec); 399 400 memcpy(&sb->s_uuid, dsb->uuid, sizeof(dsb->uuid)); 401 402 ret = strscpy(sbi->volume_name, dsb->volume_name, 403 sizeof(dsb->volume_name)); 404 if (ret < 0) { /* -E2BIG */ 405 erofs_err(sb, "bad volume name without NIL terminator"); 406 ret = -EFSCORRUPTED; 407 goto out; 408 } 409 410 /* parse on-disk compression configurations */ 411 if (erofs_sb_has_compr_cfgs(sbi)) 412 ret = erofs_load_compr_cfgs(sb, dsb); 413 else 414 ret = z_erofs_load_lz4_config(sb, dsb, NULL, 0); 415 if (ret < 0) 416 goto out; 417 418 /* handle multiple devices */ 419 ret = erofs_scan_devices(sb, dsb); 420 421 if (erofs_sb_has_ztailpacking(sbi)) 422 erofs_info(sb, "EXPERIMENTAL compressed inline data feature in use. Use at your own risk!"); 423 if (erofs_is_fscache_mode(sb)) 424 erofs_info(sb, "EXPERIMENTAL fscache-based on-demand read feature in use. Use at your own risk!"); 425 if (erofs_sb_has_fragments(sbi)) 426 erofs_info(sb, "EXPERIMENTAL compressed fragments feature in use. Use at your own risk!"); 427 if (erofs_sb_has_dedupe(sbi)) 428 erofs_info(sb, "EXPERIMENTAL global deduplication feature in use. Use at your own risk!"); 429 out: 430 erofs_put_metabuf(&buf); 431 return ret; 432 } 433
diff --git a/fs/erofs/erofs_fs.h b/fs/erofs/erofs_fs.h index ea62f83dac40..ac42a7255b39 100644 --- a/fs/erofs/erofs_fs.h +++ b/fs/erofs/erofs_fs.h @@ -27,6 +27,7 @@ #define EROFS_FEATURE_INCOMPAT_ZTAILPACKING 0x00000010 #define EROFS_FEATURE_INCOMPAT_FRAGMENTS 0x00000020 #define EROFS_FEATURE_INCOMPAT_DEDUPE 0x00000020 +#define EROFS_FEATURE_INCOMPAT_XATTR_PREFIXES 0x00000040 #define EROFS_ALL_FEATURE_INCOMPAT \ (EROFS_FEATURE_INCOMPAT_ZERO_PADDING | \ EROFS_FEATURE_INCOMPAT_COMPR_CFGS | \ @@ -36,7 +37,8 @@ EROFS_FEATURE_INCOMPAT_COMPR_HEAD2 | \ EROFS_FEATURE_INCOMPAT_ZTAILPACKING | \ EROFS_FEATURE_INCOMPAT_FRAGMENTS | \ - EROFS_FEATURE_INCOMPAT_DEDUPE) + EROFS_FEATURE_INCOMPAT_DEDUPE | \ + EROFS_FEATURE_INCOMPAT_XATTR_PREFIXES) #define EROFS_SB_EXTSLOT_SIZE 16 diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index 5a9c19654b19..f675050af2bb 100644 --- a/fs/erofs/internal.h +++ b/fs/erofs/internal.h @@ -285,6 +285,7 @@ EROFS_FEATURE_FUNCS(compr_head2, incompat, INCOMPAT_COMPR_HEAD2) EROFS_FEATURE_FUNCS(ztailpacking, incompat, INCOMPAT_ZTAILPACKING) EROFS_FEATURE_FUNCS(fragments, incompat, INCOMPAT_FRAGMENTS) EROFS_FEATURE_FUNCS(dedupe, incompat, INCOMPAT_DEDUPE) +EROFS_FEATURE_FUNCS(xattr_prefixes, incompat, INCOMPAT_XATTR_PREFIXES) EROFS_FEATURE_FUNCS(sb_chksum, compat, COMPAT_SB_CHKSUM) /* atomic flag definitions */ diff --git a/fs/erofs/super.c b/fs/erofs/super.c index bf396e0c243a..8f85cc6162e2 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -391,6 +391,9 @@ static int erofs_read_superblock(struct super_block *sb) sbi->packed_nid = le64_to_cpu(dsb->packed_nid); sbi->inos = le64_to_cpu(dsb->inos); + sbi->xattr_prefix_start = le32_to_cpu(dsb->xattr_prefix_start); + sbi->xattr_prefix_count = dsb->xattr_prefix_count; + sbi->build_time = le64_to_cpu(dsb->build_time); sbi->build_time_nsec = le32_to_cpu(dsb->build_time_nsec); @@ -822,6 +825,10 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc) if (err) return err; + err = erofs_xattr_prefixes_init(sb); + if (err) + return err; + err = erofs_register_sysfs(sb); if (err) return err; @@ -981,6 +988,7 @@ static void erofs_put_super(struct super_block *sb) erofs_unregister_sysfs(sb); erofs_shrinker_unregister(sb); + erofs_xattr_prefixes_cleanup(sb); #ifdef CONFIG_EROFS_FS_ZIP iput(sbi->managed_cache); sbi->managed_cache = NULL;