From 5d930f22ec2dcb23d9bcd9e167eb9882ce099492 Mon Sep 17 00:00:00 2001 From: Joseph Qi Date: Tue, 31 May 2022 18:43:58 +0800 Subject: [PATCH] Add atomic write support Signed-off-by: Joseph Qi --- 1002-xfsprogs-add-atomic-write-support.patch | 53 ++++++++++++++++++++ xfsprogs.spec | 7 ++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 1002-xfsprogs-add-atomic-write-support.patch diff --git a/1002-xfsprogs-add-atomic-write-support.patch b/1002-xfsprogs-add-atomic-write-support.patch new file mode 100644 index 0000000..f901bf2 --- /dev/null +++ b/1002-xfsprogs-add-atomic-write-support.patch @@ -0,0 +1,53 @@ +From c6f1dcf13e5f16585e2c8e0b750bc13111826e68 Mon Sep 17 00:00:00 2001 +From: Joseph Qi +Date: Mon, 30 May 2022 15:11:22 +0800 +Subject: [PATCH] xfsprogs: add atomic write support + +Signed-off-by: Gao Xiang +Signed-off-by: Joseph Qi +--- + libxfs/xfs_format.h | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h +index 722c9de..894adb9 100644 +--- a/libxfs/xfs_format.h ++++ b/libxfs/xfs_format.h +@@ -450,11 +450,13 @@ xfs_sb_has_compat_feature( + #define XFS_SB_FEAT_RO_COMPAT_RMAPBT (1 << 1) /* reverse map btree */ + #define XFS_SB_FEAT_RO_COMPAT_REFLINK (1 << 2) /* reflinked files */ + #define XFS_SB_FEAT_RO_COMPAT_INOBTCNT (1 << 3) /* inobt block counts */ ++#define XFS_SB_FEAT_RO_COMPAT_ATOMIC_FILE (1 << 29) /* db atomic file */ + #define XFS_SB_FEAT_RO_COMPAT_ALL \ + (XFS_SB_FEAT_RO_COMPAT_FINOBT | \ + XFS_SB_FEAT_RO_COMPAT_RMAPBT | \ + XFS_SB_FEAT_RO_COMPAT_REFLINK| \ +- XFS_SB_FEAT_RO_COMPAT_INOBTCNT) ++ XFS_SB_FEAT_RO_COMPAT_INOBTCNT | \ ++ XFS_SB_FEAT_RO_COMPAT_ATOMIC_FILE) + #define XFS_SB_FEAT_RO_COMPAT_UNKNOWN ~XFS_SB_FEAT_RO_COMPAT_ALL + static inline bool + xfs_sb_has_ro_compat_feature( +@@ -1158,14 +1160,18 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev) + #define XFS_DIFLAG2_COWEXTSIZE_BIT 2 /* copy on write extent size hint */ + #define XFS_DIFLAG2_BIGTIME_BIT 3 /* big timestamps */ + ++/* avoid using the highest bit 63 */ ++#define XFS_DIFLAG2_DIO_ATOMIC_WRITE_BIT 60 ++ + #define XFS_DIFLAG2_DAX (1 << XFS_DIFLAG2_DAX_BIT) + #define XFS_DIFLAG2_REFLINK (1 << XFS_DIFLAG2_REFLINK_BIT) + #define XFS_DIFLAG2_COWEXTSIZE (1 << XFS_DIFLAG2_COWEXTSIZE_BIT) + #define XFS_DIFLAG2_BIGTIME (1 << XFS_DIFLAG2_BIGTIME_BIT) ++#define XFS_DIFLAG2_DIO_ATOMIC_WRITE (1ULL << XFS_DIFLAG2_DIO_ATOMIC_WRITE_BIT) + + #define XFS_DIFLAG2_ANY \ + (XFS_DIFLAG2_DAX | XFS_DIFLAG2_REFLINK | XFS_DIFLAG2_COWEXTSIZE | \ +- XFS_DIFLAG2_BIGTIME) ++ XFS_DIFLAG2_BIGTIME | XFS_DIFLAG2_DIO_ATOMIC_WRITE) + + static inline bool xfs_dinode_has_bigtime(const struct xfs_dinode *dip) + { +-- +2.19.1.6.gb485710b + diff --git a/xfsprogs.spec b/xfsprogs.spec index 67aa5d2..33bbc9e 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 Summary: Utilities for managing the XFS filesystem Name: xfsprogs Version: 5.0.0 @@ -85,6 +85,7 @@ Patch62: xfsprogs-5.12.0-libfrog-report-inobtcount-in-geometry.patch # Begin: Anolis customized patches # backport patch from upstream Patch1001: 1001-xfsprogs-gcc10.patch +Patch1002: 1002-xfsprogs-add-atomic-write-support.patch # End: Anolis customized patches %description @@ -180,6 +181,7 @@ also want to install xfsprogs. %patch61 -p1 %patch62 -p1 %patch1001 -p1 +%patch1002 -p1 %build export tagname=CC @@ -239,6 +241,9 @@ rm -rf $RPM_BUILD_ROOT/%{_mandir}/man8/xfs_scrub* %{_libdir}/*.so %changelog +* Tue May 31 2022 Joseph Qi - 5.0.0-10.0.2 +- Add atomic write support + * Tue Apr 19 2022 Weitao Zhou - 5.0.0-10.0.1 - Fix gcc10 -fno-common compile issue for compatible with gcc10 build -- Gitee