From d2c828a32a3b019194051ee24607eafee517cc43 Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Mon, 9 Feb 2015 22:21:00 -0500 Subject: [PATCH] LU-6137 ldiskfs: simplify nocmtime patch Simplify the nocmtime patch by patching only ext4_current_time(), this fixed the defect that original patch doesn't handle setacl code path, it can also avoid the risk of future changes adding new places that needs to be fixed. Remove the obsolete xattr-no-update-ctime patch. Signed-off-by: Anreas Dilger Signed-off-by: Niu Yawei Change-Id: I02928c4f867e9476f0bc1815dd3256e3d79dadf7 Reviewed-on: http://review.whamcloud.com/13705 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Bobi Jam Reviewed-by: Bob Glossman Reviewed-by: Fan Yong --- .../patches/rhel6.3/ext4-nocmtime-2.6.patch | 37 ++++++++-------------- .../rhel6.3/ext4-xattr-no-update-ctime.patch | 32 ------------------- .../series/ldiskfs-2.6-rhel6.4.series | 1 - .../series/ldiskfs-2.6-rhel6.5.series | 1 - .../series/ldiskfs-2.6-rhel6.6.series | 1 - .../kernel_patches/series/ldiskfs-2.6-rhel6.series | 1 - .../series/ldiskfs-2.6-sles11.series | 1 - .../series/ldiskfs-3.0-sles11.series | 1 - .../series/ldiskfs-3.0-sles11sp3.series | 1 - 9 files changed, 14 insertions(+), 62 deletions(-) delete mode 100644 ldiskfs/kernel_patches/patches/rhel6.3/ext4-xattr-no-update-ctime.patch diff --git a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-nocmtime-2.6.patch b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-nocmtime-2.6.patch index eec475a..bbc8853 100644 --- a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-nocmtime-2.6.patch +++ b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-nocmtime-2.6.patch @@ -1,23 +1,14 @@ ---- linux-2.6.18-194.3.1/fs/ext4/xattr.c 2010-11-23 21:13:35.000000000 -0800 -+++ linux-2.6.18-194.3.1-liang/fs/ext4/xattr.c 2010-11-25 20:15:27.000000000 -0800 -@@ -1050,7 +1050,7 @@ ext4_xattr_set_handle(handle_t *handle, - } - if (!error) { - ext4_xattr_update_super_block(handle, inode->i_sb); -- if (!(flags & XATTR_NO_CTIME)) -+ if (!IS_NOCMTIME(inode) && !(flags & XATTR_NO_CTIME)) - inode->i_ctime = ext4_current_time(inode); - if (!value) - EXT4_I(inode)->i_state &= ~EXT4_STATE_NO_EXPAND; ---- linux-2.6.18-194.3.1/fs/ext4/namei.c 2010-11-23 21:13:35.000000000 -0800 -+++ linux-2.6.18-194.3.1-liang/fs/ext4/namei.c 2010-11-25 20:17:25.000000000 -0800 -@@ -1465,7 +1465,8 @@ static int add_dirent_to_buf(handle_t *h - * happen is that the times are slightly out of date - * and/or different from the directory change time. - */ -- dir->i_mtime = dir->i_ctime = ext4_current_time(dir); -+ if (!IS_NOCMTIME(dir)) -+ dir->i_mtime = dir->i_ctime = ext4_current_time(dir); - ext4_update_dx_flag(dir); - dir->i_version++; - ext4_mark_inode_dirty(handle, dir); +Index: linux-stage/fs/ext4/ext4.h +=================================================================== +--- linux-stage.orig/fs/ext4/ext4.h ++++ linux-stage/fs/ext4/ext4.h +@@ -1213,6 +1213,9 @@ static inline struct ext4_inode_info *EX + + static inline struct timespec ext4_current_time(struct inode *inode) + { ++ if (IS_NOCMTIME(inode)) ++ return inode->i_ctime; ++ + return (inode->i_sb->s_time_gran < NSEC_PER_SEC) ? + current_fs_time(inode->i_sb) : CURRENT_TIME_SEC; + } diff --git a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-xattr-no-update-ctime.patch b/ldiskfs/kernel_patches/patches/rhel6.3/ext4-xattr-no-update-ctime.patch deleted file mode 100644 index 66de9df..0000000 --- a/ldiskfs/kernel_patches/patches/rhel6.3/ext4-xattr-no-update-ctime.patch +++ /dev/null @@ -1,32 +0,0 @@ -Index: linux-2.6.18.i386/fs/ext4/ext4.h -=================================================================== ---- linux-2.6.18.i386.orig/fs/ext4/ext4.h -+++ linux-2.6.18.i386/fs/ext4/ext4.h -@@ -995,6 +995,13 @@ struct mmp_struct { - extern struct proc_dir_entry *proc_root_ext4; - - /* -+ * Indicates that ctime should not be updated in ext4_xattr_set_handle() -+ */ -+#ifndef XATTR_NO_CTIME -+#define XATTR_NO_CTIME 0x80 -+#endif -+ -+/* - * Function prototypes - */ - -Index: linux-2.6.18.i386/fs/ext4/xattr.c -=================================================================== ---- linux-2.6.18.i386.orig/fs/ext4/xattr.c -+++ linux-2.6.18.i386/fs/ext4/xattr.c -@@ -1026,7 +1026,8 @@ ext4_xattr_set_handle(handle_t *handle, - } - if (!error) { - ext4_xattr_update_super_block(handle, inode->i_sb); -- inode->i_ctime = ext4_current_time(inode); -+ if (!(flags & XATTR_NO_CTIME)) -+ inode->i_ctime = ext4_current_time(inode); - if (!value) - EXT4_I(inode)->i_state &= ~EXT4_STATE_NO_EXPAND; - error = ext4_mark_iloc_dirty(handle, inode, &is.iloc); diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series index 55aad11..68f4c1c 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.4.series @@ -12,7 +12,6 @@ rhel6.3/ext4-inode-version.patch rhel6.4/ext4-mmp.patch rhel6.3/ext4-lookup-dotdot.patch rhel6.3/ext4-print-inum-in-htree-warning.patch -rhel6.3/ext4-xattr-no-update-ctime.patch rhel6.4/ext4-prealloc.patch rhel6.3/ext4-mballoc-extra-checks.patch rhel6.4/ext4-misc.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series index f080888..7dc5eba 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.5.series @@ -12,7 +12,6 @@ rhel6.3/ext4-inode-version.patch rhel6.4/ext4-mmp.patch rhel6.3/ext4-lookup-dotdot.patch rhel6.3/ext4-print-inum-in-htree-warning.patch -rhel6.3/ext4-xattr-no-update-ctime.patch rhel6.4/ext4-prealloc.patch rhel6.3/ext4-mballoc-extra-checks.patch rhel6.4/ext4-misc.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series index fefd631..7838a78 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.6.series @@ -11,7 +11,6 @@ sles11sp1/ext4-ext_generation.patch rhel6.3/ext4-inode-version.patch rhel6.3/ext4-lookup-dotdot.patch rhel6.3/ext4-print-inum-in-htree-warning.patch -rhel6.3/ext4-xattr-no-update-ctime.patch rhel6.4/ext4-prealloc.patch rhel6.3/ext4-mballoc-extra-checks.patch rhel6.4/ext4-misc.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series index 24557ed..51f2b2e 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel6.series @@ -12,7 +12,6 @@ rhel6.3/ext4-inode-version.patch rhel6.3/ext4-mmp.patch rhel6.3/ext4-lookup-dotdot.patch rhel6.3/ext4-print-inum-in-htree-warning.patch -rhel6.3/ext4-xattr-no-update-ctime.patch rhel6.3/ext4-prealloc.patch rhel6.3/ext4-mballoc-extra-checks.patch rhel6.3/ext4-misc.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series index 78d6833..abe72c1 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series @@ -13,7 +13,6 @@ rhel6.3/ext4-use-ext4_kvzalloc-ext4_kvmalloc-for-s_group_desc-and-s_group_info.p rhel6.3/ext4-mmp.patch rhel6.3/ext4-lookup-dotdot.patch rhel6.3/ext4-print-inum-in-htree-warning.patch -rhel6.3/ext4-xattr-no-update-ctime.patch rhel6.3/ext4-prealloc.patch rhel6.3/ext4-mballoc-extra-checks.patch rhel6.3/ext4-misc.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series index e69fa59..99e607a 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11.series @@ -16,7 +16,6 @@ sles11sp2/ext4-ext_generation.patch rhel6.3/ext4-inode-version.patch sles11sp2/ext4-lookup-dotdot.patch rhel6.3/ext4-print-inum-in-htree-warning.patch -rhel6.3/ext4-xattr-no-update-ctime.patch sles11sp2/ext4-prealloc.patch sles11sp2/ext4-mballoc-extra-checks.patch sles11sp2/restore-path-in-walk_extent_callback.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp3.series b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp3.series index 7a9f122..ef56002 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp3.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.0-sles11sp3.series @@ -16,7 +16,6 @@ sles11sp2/ext4-ext_generation.patch rhel6.3/ext4-inode-version.patch sles11sp2/ext4-lookup-dotdot.patch rhel6.3/ext4-print-inum-in-htree-warning.patch -rhel6.3/ext4-xattr-no-update-ctime.patch sles11sp2/ext4-prealloc.patch sles11sp2/ext4-mballoc-extra-checks.patch sles11sp2/restore-path-in-walk_extent_callback.patch -- 1.8.3.1