Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock
X-Debbugs-Cc: fsarchi...@packages.debian.org
Control: affects -1 + src:fsarchiver

Please unblock package fsarchiver

[ Reason ]
Creating file systems with recent versions of
btrfs-progs/e2fsprogs/xfsprogs
on recent kernels might make use of kernel/fs features like nrext64 or 
orphan_file.
Older versions of fsarchiver will not know how to handle those fs
features and fail to save/restore a backup.
See e.g. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1033117



[ Impact ]
Not shipping an up-to-date fsarchiver might result in failures when
trying to backup/restore xfs/btrfs/ext4 partitions that were created
with features that are unknown to fsarchiver.

[ Tests ]
fsarchiver ships an autopkgtest for ext4 and xfs.
Those tests use the default settings when creating a new file system and
they triggered the ext4 related incompatible changes
 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1033117

[ Risks ]
fsarchiver is a leaf package, so its effect on other packages is
minimal.

[ Checklist ]
  [x] ext4 related changes are documented in the d/changelog 
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in testing

The debdiff was created filtering out auto* noise using
git diff debian/0.8.6-2 ':!config.guess' ':!config.sub' ':!*Makefile.in' 
':!configure' ':!aclocal.m4'

unblock fsarchiver/0.8.7-1
diff --git a/ChangeLog b/ChangeLog
index 39bfbda..35ebc94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 fsarchiver: Filesystem Archiver for Linux [http://www.fsarchiver.org]
 =====================================================================
+* 0.8.7 (2023-03-19):
+  - Implement support for option "uuid=" for vfat (Marcos Mello)
+  - Update list of btrfs supported features (Marcos Mello)
+  - Add support for the "nrext64" feature on XFS (Marcos Mello)
+  - Do not error out on deleted files when option -A is used (Marcos Mello)
+  - Handle termination by signal in exec_command() (Marcos Mello)
+  - Add support for the "orphan_file" feature in EXT4 (Marcos Mello)
+  - Do not try to save xattrs if not supported by the filesystem (Marcos Mello)
 * 0.8.6 (2021-02-27):
   - Add support for EXT4 fast_commit feature (Marcos Mello)
   - Add support for XFS features inobtcount and bigtime (Marcos Mello)
diff --git a/INSTALL b/INSTALL
index 8865734..e82fd21 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,8 @@
 Installation Instructions
 *************************
 
-   Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
-Foundation, Inc.
+   Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free
+Software Foundation, Inc.
 
    Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
@@ -225,7 +225,7 @@ order to use an ANSI C compiler:
 
 and if that doesn't work, install pre-built binaries of GCC for HP-UX.
 
-   HP-UX 'make' updates targets which have the same time stamps as their
+   HP-UX 'make' updates targets which have the same timestamps as their
 prerequisites, which makes it generally unusable when shipped generated
 files such as 'configure' are involved.  Use GNU 'make' instead.
 
diff --git a/compile b/compile
index 23fcba0..df363c8 100755
--- a/compile
+++ b/compile
@@ -3,7 +3,7 @@
 
 scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
 # Written by Tom Tromey <tro...@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
diff --git a/configure.ac b/configure.ac
index ec838a3..2948877 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,8 +3,8 @@
 
 AC_PREREQ(2.59)
 
-AC_INIT([fsarchiver], 0.8.6)
-AC_DEFINE([PACKAGE_RELDATE], "2021-02-27", [Define the date of the release])
+AC_INIT([fsarchiver], 0.8.7)
+AC_DEFINE([PACKAGE_RELDATE], "2023-03-19", [Define the date of the release])
 AC_DEFINE([PACKAGE_FILEFMT], "FsArCh_002", [Define the version of the file 
format])
 AC_DEFINE([PACKAGE_VERSION_A], 0, [Major version number])
 AC_DEFINE([PACKAGE_VERSION_B], 8, [Medium version number])
diff --git a/debian/changelog b/debian/changelog
index f006387..466725d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+fsarchiver (0.8.7-1) unstable; urgency=medium
+
+  * New upstream version 0.8.7
+    - Fixes compatibility with e2fsprogs >= 1.47. (Closes: #1033117)
+  * Update debian/watch.
+    Use the GitHub API when checking for new upstream releases.
+  * Bump Standards-Version to 4.6.2
+  * Update obsolete Build-Depends e2fslibs-dev => libext2fs-dev
+
+ -- Michael Biebl <bi...@debian.org>  Tue, 28 Mar 2023 20:34:29 +0200
+
 fsarchiver (0.8.6-2) unstable; urgency=medium
 
   [ Julian Andres Klode ]
diff --git a/debian/control b/debian/control
index e190dd3..e83f49a 100644
--- a/debian/control
+++ b/debian/control
@@ -10,12 +10,12 @@ Build-Depends: debhelper-compat (= 13),
                liblz4-dev,
                libzstd-dev,
                libgcrypt20-dev,
-               e2fslibs-dev,
+               libext2fs-dev,
                uuid-dev,
                libblkid-dev,
                libattr1-dev,
                pkg-config
-Standards-Version: 4.6.1
+Standards-Version: 4.6.2
 Rules-Requires-Root: no
 Vcs-Git: https://salsa.debian.org/debian/fsarchiver.git
 Vcs-Browser: https://salsa.debian.org/debian/fsarchiver
diff --git a/debian/tests/backup-and-restore-directory.sh 
b/debian/tests/backup-and-restore-directory.sh
old mode 100644
new mode 100755
diff --git a/debian/watch b/debian/watch
index 6836246..f04437e 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,2 +1,4 @@
-version=3
-https://github.com/fdupoux/fsarchiver/releases/ 
.*/fsarchiver-([\d\.]+)\.tar\.gz
+version=4
+opts="searchmode=plain" \
+  https://api.github.com/repos/fdupoux/@PACKAGE@/releases \
+  
https://github.com/fdupoux/@PACKAGE@/releases/download/(?:\d[\d.]*)/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@
diff --git a/depcomp b/depcomp
index 6b39162..715e343 100755
--- a/depcomp
+++ b/depcomp
@@ -3,7 +3,7 @@
 
 scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/distrib/rpm/fsarchiver.spec b/distrib/rpm/fsarchiver.spec
index 66ad4b0..7e0a5fc 100644
--- a/distrib/rpm/fsarchiver.spec
+++ b/distrib/rpm/fsarchiver.spec
@@ -1,5 +1,5 @@
 Name:          fsarchiver
-Version:       0.8.6
+Version:       0.8.7
 Release:       1%{?dist}
 Summary:       Safe and flexible file-system backup/deployment tool
 
diff --git a/doc/fsarchiver.8 b/doc/fsarchiver.8
index 91f962b..ccafe96 100644
--- a/doc/fsarchiver.8
+++ b/doc/fsarchiver.8
@@ -131,7 +131,8 @@ read-write mode which allows modifications to be done on 
the filesystem
 during the backup. Modifications can drive to inconsistencies in the
 backup. Using LVM snapshots is the recommended way to make backups since it
 will provide consistency, but it is only available for filesystems which
-are on LVM logical volumes.
+are on LVM logical volumes. Deleted files during the backup process are
+ignored when this option is used.
 .IP "\fB\-a, \-\-allow-no-acl-xattr\fP"
 Allow to save a filesystem when ACLs and extended attributes are not
 supported (or are disabled) by the kernel. By default fsarchiver fails with
diff --git a/missing b/missing
index 8d0eaad..1fe1611 100755
--- a/missing
+++ b/missing
@@ -3,7 +3,7 @@
 
 scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pin...@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
diff --git a/src/common.c b/src/common.c
index 6d740de..dee53b0 100644
--- a/src/common.c
+++ b/src/common.c
@@ -261,7 +261,6 @@ int getpathtoprog(char *buffer, int bufsize, char *prog)
 {
     char pathtest[PATH_MAX];
     char delims[]=":\t\n";
-    struct stat bufstat;
     char pathenv[4096];
     char *saveptr=0;
     char *result;
@@ -276,7 +275,7 @@ int getpathtoprog(char *buffer, int bufsize, char *prog)
     for(i=0; result != NULL; i++)
     {
         snprintf(pathtest, sizeof(pathtest), "%s/%s", result, prog);
-        if (stat(pathtest, &bufstat)==0 && access(pathtest, X_OK)==0)
+        if (access(pathtest, X_OK)==0)
         {
             snprintf(buffer, bufsize, "%s", pathtest);
             return 0;
@@ -403,9 +402,10 @@ int exec_command(char *command, int cmdbufsize, int 
*exitst, char *stdoutbuf, in
         if ((stderrbuf!=NULL) && (errpos+1 < stderrsize))
             read(mystderr, stderrbuf+errpos, stderrsize-errpos-1);
         
-        msgprintf(MSG_VERB1, "command [%s] returned %d\n", command, 
WEXITSTATUS(status));
+        status = WIFSIGNALED(status) ? 128 + WTERMSIG(status) : 
WEXITSTATUS(status);
+        msgprintf(MSG_VERB1, "command [%s] returned %d\n", command, status);
         if (exitst)
-            *exitst=WEXITSTATUS(status);
+            *exitst=status;
         
         if ((stdoutbuf!=NULL) && (outpos>0))
             msgprintf(MSG_DEBUG1, "\n----stdout----\n%s\n----stdout----\n\n", 
stdoutbuf);
diff --git a/src/fs_btrfs.h b/src/fs_btrfs.h
index b41582b..13925eb 100644
--- a/src/fs_btrfs.h
+++ b/src/fs_btrfs.h
@@ -29,33 +29,48 @@ int btrfs_check_support_for_features(u64 compat, u64 
incompat, u64 ro_compat);
 int btrfs_get_reqmntopt(char *partition, struct s_strlist *reqopt, struct 
s_strlist *badopt);
 int btrfs_test(char *devname);
 
-// compat flags: official definition from linux-3.14/fs/btrfs/ctree.h
+// compat flags: official definition from linux-5.15/fs/btrfs/ctree.h
+// and linux-5.15/include/uapi/linux/btrfs.h
+#define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE        (1ULL << 0)
+#define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID  (1ULL << 1)
+#define BTRFS_FEATURE_COMPAT_RO_VERITY                 (1ULL << 2)
+
 #define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF    (1ULL << 0)
 #define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL   (1ULL << 1)
 #define BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS     (1ULL << 2)
 #define BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO     (1ULL << 3)
-#define BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2   (1ULL << 4)
+#define BTRFS_FEATURE_INCOMPAT_COMPRESS_ZSTD    (1ULL << 4)
 #define BTRFS_FEATURE_INCOMPAT_BIG_METADATA     (1ULL << 5)
 #define BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF    (1ULL << 6)
 #define BTRFS_FEATURE_INCOMPAT_RAID56           (1ULL << 7)
 #define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA  (1ULL << 8)
 #define BTRFS_FEATURE_INCOMPAT_NO_HOLES         (1ULL << 9)
+#define BTRFS_FEATURE_INCOMPAT_METADATA_UUID    (1ULL << 10)
+#define BTRFS_FEATURE_INCOMPAT_RAID1C34         (1ULL << 11)
+#define BTRFS_FEATURE_INCOMPAT_ZONED            (1ULL << 12)
 
 // compat flags: btrfs features that this fsarchiver version supports
 #define FSA_BTRFS_FEATURE_COMPAT_SUPP           0ULL
-#define FSA_BTRFS_FEATURE_COMPAT_RO_SUPP        0ULL
+
+#define FSA_BTRFS_FEATURE_COMPAT_RO_SUPP                 \
+        (BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE |       \
+         BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID | \
+         BTRFS_FEATURE_COMPAT_RO_VERITY)
+
 #define FSA_BTRFS_FEATURE_INCOMPAT_SUPP                 \
         (BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF |         \
          BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL |        \
          BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS |          \
          BTRFS_FEATURE_INCOMPAT_BIG_METADATA |          \
          BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO |          \
-         BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2 |        \
+         BTRFS_FEATURE_INCOMPAT_COMPRESS_ZSTD |         \
          BTRFS_FEATURE_INCOMPAT_RAID56 |                \
          BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF |         \
          BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA |       \
-         BTRFS_FEATURE_INCOMPAT_NO_HOLES)
-
+         BTRFS_FEATURE_INCOMPAT_NO_HOLES |              \
+         BTRFS_FEATURE_INCOMPAT_METADATA_UUID |         \
+         BTRFS_FEATURE_INCOMPAT_RAID1C34 |              \
+         BTRFS_FEATURE_INCOMPAT_ZONED)
 
 // disk layout definitions
 #define BTRFS_SUPER_MAGIC 0x9123683E
diff --git a/src/fs_ext2.c b/src/fs_ext2.c
index a85a8d7..ccf878a 100644
--- a/src/fs_ext2.c
+++ b/src/fs_ext2.c
@@ -59,7 +59,7 @@ struct s_features
 // us and therefore is not preserved (i.e. present in 
FSA_FEATURE_INCOMPAT_SUPP but not listed
 // below). Users can easily enable it with tune2fs if desired.
 //
-struct s_features mkfeatures[] = // cf e2fsprogs-1.46.0/lib/e2p/feature.c
+struct s_features mkfeatures[] = // cf e2fsprogs-1.47.0/lib/e2p/feature.c
 {
     {"has_journal",   FSA_EXT3_FEATURE_COMPAT_HAS_JOURNAL,      
E2P_FEATURE_COMPAT,      EXTFSTYPE_EXT3, PROGVER(1,39,0)},
     {"ext_attr",      FSA_EXT2_FEATURE_COMPAT_EXT_ATTR,         
E2P_FEATURE_COMPAT,      EXTFSTYPE_EXT2, PROGVER(1,40,5)},
@@ -67,6 +67,7 @@ struct s_features mkfeatures[] = // cf 
e2fsprogs-1.46.0/lib/e2p/feature.c
     {"dir_index",     FSA_EXT2_FEATURE_COMPAT_DIR_INDEX,        
E2P_FEATURE_COMPAT,      EXTFSTYPE_EXT2, PROGVER(1,33,0)},
     {"sparse_super2", FSA_EXT4_FEATURE_COMPAT_SPARSE_SUPER2,    
E2P_FEATURE_COMPAT,      EXTFSTYPE_EXT4, PROGVER(1,42,10)},
     {"fast_commit",   FSA_EXT4_FEATURE_COMPAT_FAST_COMMIT,      
E2P_FEATURE_COMPAT,      EXTFSTYPE_EXT4, PROGVER(1,46,0)},
+    {"orphan_file",   FSA_EXT4_FEATURE_COMPAT_ORPHAN_FILE,      
E2P_FEATURE_COMPAT,      EXTFSTYPE_EXT4, PROGVER(1,47,0)},
     {"filetype",      FSA_EXT2_FEATURE_INCOMPAT_FILETYPE,       
E2P_FEATURE_INCOMPAT,    EXTFSTYPE_EXT2, PROGVER(1,16,0)},
     {"extent",        FSA_EXT4_FEATURE_INCOMPAT_EXTENTS,        
E2P_FEATURE_INCOMPAT,    EXTFSTYPE_EXT4, PROGVER(1,41,0)},
     {"journal_dev",   FSA_EXT3_FEATURE_INCOMPAT_JOURNAL_DEV,    
E2P_FEATURE_INCOMPAT,    EXTFSTYPE_EXT3, PROGVER(1,39,0)},
@@ -176,7 +177,6 @@ int extfs_mkfs(cdico *d, char *partition, int extfstype, 
char *fsoptions, char *
     u64 temp64;
     int exitst;
     int ret=0;
-    int res;
     int i;
 
     // init
@@ -413,7 +413,7 @@ int extfs_mkfs(cdico *d, char *partition, int extfstype, 
char *fsoptions, char *
         // http://marc.info/?l=linux-ext4&m=123246035924487&w=2
         if (extfstype==EXTFSTYPE_EXT4 && !mke2fsuuid)
         {
-            if ( ((res=exec_command(command, sizeof(command), &exitst, NULL, 
0, NULL, 0, "e2fsck -fy %s", partition))!=0) || ((exitst!=0) && (exitst!=1)) )
+            if (exec_command(command, sizeof(command), &exitst, NULL, 0, NULL, 
0, "e2fsck -fy %s", partition)!=0 || (exitst!=0 && exitst!=1))
             {   errprintf("command [%s] failed with return status=%d\n", 
command, exitst);
                 ret=-1;
                 goto extfs_mkfs_cleanup;
diff --git a/src/fs_ext2.h b/src/fs_ext2.h
index d11c8b4..f1da6e4 100644
--- a/src/fs_ext2.h
+++ b/src/fs_ext2.h
@@ -49,6 +49,7 @@ u64 check_prog_version(char *prog);
 #define FSA_EXT4_FEATURE_COMPAT_SPARSE_SUPER2      0x0200
 #define FSA_EXT4_FEATURE_COMPAT_FAST_COMMIT        0x0400
 #define FSA_EXT4_FEATURE_COMPAT_STABLE_INODES      0x0800
+#define FSA_EXT4_FEATURE_COMPAT_ORPHAN_FILE        0x1000
 
 /* for s_feature_ro_compat */
 #define FSA_EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER    0x0001
@@ -63,6 +64,7 @@ u64 check_prog_version(char *prog);
 #define FSA_EXT4_FEATURE_RO_COMPAT_METADATA_CSUM   0x0400
 #define FSA_EXT4_FEATURE_RO_COMPAT_READONLY        0x1000
 #define FSA_EXT4_FEATURE_RO_COMPAT_PROJECT         0x2000
+#define FSA_EXT4_FEATURE_RO_COMPAT_ORPHAN_PRESENT  0x10000
 
 /* for s_feature_incompat */
 #define FSA_EXT2_FEATURE_INCOMPAT_FILETYPE         0x0002
@@ -109,7 +111,8 @@ u64 check_prog_version(char *prog);
                                                          
FSA_EXT2_FEATURE_COMPAT_DIR_INDEX|\
                                                          
FSA_EXT2_FEATURE_COMPAT_LAZY_BG|\
                                                          
FSA_EXT4_FEATURE_COMPAT_SPARSE_SUPER2|\
-                                                         
FSA_EXT4_FEATURE_COMPAT_FAST_COMMIT)
+                                                         
FSA_EXT4_FEATURE_COMPAT_FAST_COMMIT|\
+                                                         
FSA_EXT4_FEATURE_COMPAT_ORPHAN_FILE)
 #define FSA_FEATURE_RO_COMPAT_SUPP                 
(u64)(FSA_EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER|\
                                                          
FSA_EXT2_FEATURE_RO_COMPAT_LARGE_FILE|\
                                                          
FSA_EXT2_FEATURE_RO_COMPAT_BTREE_DIR|\
@@ -121,7 +124,8 @@ u64 check_prog_version(char *prog);
                                                          
FSA_EXT4_FEATURE_RO_COMPAT_BIGALLOC|\
                                                          
FSA_EXT4_FEATURE_RO_COMPAT_METADATA_CSUM|\
                                                          
FSA_EXT4_FEATURE_RO_COMPAT_READONLY|\
-                                                         
FSA_EXT4_FEATURE_RO_COMPAT_PROJECT)
+                                                         
FSA_EXT4_FEATURE_RO_COMPAT_PROJECT|\
+                                                         
FSA_EXT4_FEATURE_RO_COMPAT_ORPHAN_PRESENT)
 #define FSA_FEATURE_INCOMPAT_SUPP                  
(u64)(FSA_EXT2_FEATURE_INCOMPAT_FILETYPE|\
                                                          
FSA_EXT3_FEATURE_INCOMPAT_RECOVER|\
                                                          
FSA_EXT3_FEATURE_INCOMPAT_JOURNAL_DEV|\
diff --git a/src/fs_vfat.c b/src/fs_vfat.c
index f00fbb9..47e35a9 100644
--- a/src/fs_vfat.c
+++ b/src/fs_vfat.c
@@ -65,7 +65,9 @@ int vfat_mkfs(cdico *d, char *partition, char *fsoptions, 
char *mkfslabel, char
         strlcatf(mkfsopts, sizeof(mkfsopts), " -n '%.11s' ", buffer);
 
     // ---- filesystem serial
-    if (dico_get_u32(d, 0, FSYSHEADKEY_FSVFATSERIAL, &temp32)==0)
+    if (strlen(mkfsuuid) > 0)
+        strlcatf(mkfsopts, sizeof(mkfsopts), " -i '%.8s' ", mkfsuuid);
+    else if (dico_get_u32(d, 0, FSYSHEADKEY_FSVFATSERIAL, &temp32)==0)
         strlcatf(mkfsopts, sizeof(mkfsopts), " -i '%08X' ", temp32);
 
     // ---- mkfsopt from command line
diff --git a/src/fs_xfs.c b/src/fs_xfs.c
index 043d9e3..e8c34d5 100644
--- a/src/fs_xfs.c
+++ b/src/fs_xfs.c
@@ -170,8 +170,7 @@ int xfs_mkfs(cdico *d, char *partition, char *fsoptions, 
char *mkfslabel, char *
     }
 
     // Determine if the "rmapbt" mkfs option should be enabled (reverse 
mapping btree)
-    // - starting with linux-4.8 XFS has added a btree that maps filesystem 
blocks to
-    //   their owner
+    // - starting with linux-4.8 XFS has added a btree that maps filesystem 
blocks to their owner
     // - this feature relies on the V5 on-disk format but it is optional
     // - this feature will be enabled if the original filesystem was XFS V5 
and had it
     if (xfstoolsver >= PROGVER(4,8,0)) // only use "rmapbt" option when it is 
supported by mkfs
@@ -196,6 +195,7 @@ int xfs_mkfs(cdico *d, char *partition, char *fsoptions, 
char *mkfslabel, char *
     //   to reduce mount times
     // - this optional feature relies on the V5 on-disk format and on the 
"finobt"
     //   (free inode btree) mkfs option being enabled
+    // - this feature is enabled by default when using xfsprogs-5.15.0 or later
     // - this feature will be enabled if the original filesystem was XFS V5 
and had it
     if (xfstoolsver >= PROGVER(5,10,0)) // only use "inobtcount" option when 
it is supported by mkfs
     {
@@ -206,6 +206,7 @@ int xfs_mkfs(cdico *d, char *partition, char *fsoptions, 
char *mkfslabel, char *
     // Determine if the "bigtime" mkfs option should be enabled (large 
timestamps)
     // - starting with linux-5.10 XFS has added support for larger inode 
timestamps, beyond january 2038
     // - this feature relies on the V5 on-disk format but it is optional
+    // - this feature is enabled by default when using xfsprogs-5.15.0 or later
     // - this feature will be enabled if the original filesystem was XFS V5 
and had it
     if (xfstoolsver >= PROGVER(5,10,0)) // only use "bigtime" option when it 
is supported by mkfs
     {
@@ -262,6 +263,16 @@ int xfs_mkfs(cdico *d, char *partition, char *fsoptions, 
char *mkfslabel, char *
         strlcatf(mkfsopts, sizeof(mkfsopts), " -i sparse=%d ", (int)optval);
     }
 
+    // Determine if the "nrext64" mkfs option should be enabled (large extent 
counters)
+    // - starting with linux-5.19 XFS has added support for larger number of 
per-file extents
+    // - this feature relies on the V5 on-disk format but it is optional
+    // - this feature will be enabled if the original filesystem was XFS V5 
and had it
+    if (xfstoolsver >= PROGVER(5,19,0)) // only use "nrext64" option when it 
is supported by mkfs
+    {
+        optval = ((xfsver==XFS_SB_VERSION_5) && (sb_features_incompat & 
XFS_SB_FEAT_INCOMPAT_NREXT64));
+        strlcatf(mkfsopts, sizeof(mkfsopts), " -i nrext64=%d ", (int)optval);
+    }
+
     // ---- mkfsopt from command line
     strlcatf(mkfsopts, sizeof(mkfsopts), " %s ", fsoptions);
 
diff --git a/src/fs_xfs.h b/src/fs_xfs.h
index 9fbe049..99461ce 100644
--- a/src/fs_xfs.h
+++ b/src/fs_xfs.h
@@ -190,6 +190,8 @@ struct xfs_sb
 #define XFS_SB_FEAT_INCOMPAT_SPINODES     (1 << 1)  /* sparse inode chunks */
 #define XFS_SB_FEAT_INCOMPAT_META_UUID    (1 << 2)  /* metadata UUID */
 #define XFS_SB_FEAT_INCOMPAT_BIGTIME      (1 << 3)  /* large timestamps */
+#define XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR  (1 << 4)  /* needs xfs_repair */
+#define XFS_SB_FEAT_INCOMPAT_NREXT64      (1 << 5)  /* large extent counters */
 
 // features supported by the current fsarchiver version
 #define FSA_XFS_FEATURE_COMPAT_SUPP       (u64)(0)
@@ -200,7 +202,9 @@ struct xfs_sb
 #define FSA_XFS_FEATURE_INCOMPAT_SUPP     (u64)(XFS_SB_FEAT_INCOMPAT_FTYPE|\
                                                 XFS_SB_FEAT_INCOMPAT_SPINODES|\
                                                 
XFS_SB_FEAT_INCOMPAT_META_UUID|\
-                                                XFS_SB_FEAT_INCOMPAT_BIGTIME)
+                                                XFS_SB_FEAT_INCOMPAT_BIGTIME|\
+                                                
XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR|\
+                                                XFS_SB_FEAT_INCOMPAT_NREXT64)
 #define FSA_XFS_FEATURE_LOG_INCOMPAT_SUPP (u64)(0)
 
 #endif // __FS_XFS_H__
diff --git a/src/oper_save.c b/src/oper_save.c
index ff29074..8cdd3f9 100644
--- a/src/oper_save.c
+++ b/src/oper_save.c
@@ -615,9 +615,14 @@ int createar_save_file(csavear *save, char *root, char 
*relpath, struct stat64 *
     }
     
     // ---- backup other file attributes (xattr + winattr)
-    if (createar_item_xattr(save, root, relpath, statbuf, dicoattr)!=0)
-    {   msgprintf(MSG_STACK, "backup_item_xattr() failed: cannot prepare 
xattr-dico for item %s\n", relpath);
-        attrerrors++;
+    // selinux can present fake xattrs
+    // do not try to save them if not supported by the filesystem, otherwise 
restoration will fail
+    if (filesys[save->fstype].support_for_xattr==true)
+    {
+        if (createar_item_xattr(save, root, relpath, statbuf, dicoattr)!=0)
+        {   msgprintf(MSG_STACK, "backup_item_xattr() failed: cannot prepare 
xattr-dico for item %s\n", relpath);
+            attrerrors++;
+        }
     }
     
     if (filesys[save->fstype].winattr==true)
@@ -778,9 +783,16 @@ int createar_save_directory(csavear *save, char *root, 
char *path, u64 *costeval
         
         // ---- get details about current file
         if (lstat64(fullpath, &statbuf)!=0)
-        {   sysprintf("cannot lstat64(%s)\n", fullpath);
-            ret=-1;
-            goto backup_dir_err;
+        {
+            if (g_options.allowsaverw==0)
+            {   sysprintf("cannot lstat64(%s)\n", fullpath);
+                ret=-1;
+                goto backup_dir_err;
+            }
+            else
+            {   sysprintf("cannot lstat64(%s), ignoring\n", fullpath);
+                continue; // not a fatal error with option '-A'
+            }
         }
         
         // check the list of excluded files/dirs

Reply via email to