From d76c5298e8f519b14001173d24e4c085de22876b Mon Sep 17 00:00:00 2001 From: kalpak Date: Sat, 19 Jul 2008 13:16:39 +0000 Subject: [PATCH] b=16199 i=adilger i=girish ctime should not be updated through filter_set_md() --- .../ext3-xattr-no-update-ctime-2.6-sles10.patch | 33 +++++++++++ ...ext3-xattr-no-update-ctime-2.6.22-vanilla.patch | 32 +++++++++++ .../patches/ext3-xattr-no-update-ctime-rhel4.patch | 65 ++++++++++++++++++++++ .../patches/ext3-xattr-no-update-ctime-suse.patch | 59 ++++++++++++++++++++ 4 files changed, 189 insertions(+) create mode 100644 ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-2.6-sles10.patch create mode 100644 ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-2.6.22-vanilla.patch create mode 100644 ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-rhel4.patch create mode 100644 ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-suse.patch diff --git a/ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-2.6-sles10.patch b/ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-2.6-sles10.patch new file mode 100644 index 0000000..5b5b907 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-2.6-sles10.patch @@ -0,0 +1,33 @@ +Index: linux-2.6.16.54-0.2.5/include/linux/ext3_fs.h +=================================================================== +--- linux-2.6.16.54-0.2.5.orig/include/linux/ext3_fs.h ++++ linux-2.6.16.54-0.2.5/include/linux/ext3_fs.h +@@ -913,6 +913,13 @@ struct mmp_struct { + #define EXT3_MMP_MIN_CHECK_INTERVAL 5 + + /* ++ * Indicates that ctime should not be updated in ext3_xattr_set_handle() ++ */ ++#ifndef XATTR_NO_CTIME ++#define XATTR_NO_CTIME 0x80 ++#endif ++ ++/* + * Function prototypes + */ + +Index: linux-2.6.16.54-0.2.5/fs/ext3/xattr.c +=================================================================== +--- linux-2.6.16.54-0.2.5.orig/fs/ext3/xattr.c ++++ linux-2.6.16.54-0.2.5/fs/ext3/xattr.c +@@ -1030,8 +1030,8 @@ ext3_xattr_set_handle(handle_t *handle, + } + if (!error) { + ext3_xattr_update_super_block(handle, inode->i_sb); +- inode->i_ctime = ext3_current_time(inode); +- ++ if (!(flags & XATTR_NO_CTIME)) ++ inode->i_ctime = ext3_current_time(inode); + error = ext3_mark_iloc_dirty(handle, inode, &is.iloc); + if (!value) + EXT3_I(inode)->i_state &= ~EXT3_STATE_NO_EXPAND; diff --git a/ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-2.6.22-vanilla.patch b/ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-2.6.22-vanilla.patch new file mode 100644 index 0000000..2fe2f47 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-2.6.22-vanilla.patch @@ -0,0 +1,32 @@ +Index: linux-2.6.22.14/include/linux/ext3_fs.h +=================================================================== +--- linux-2.6.22.14.orig/include/linux/ext3_fs.h ++++ linux-2.6.22.14/include/linux/ext3_fs.h +@@ -923,6 +923,13 @@ struct mmp_struct { + #define EXT3_MMP_MIN_CHECK_INTERVAL 5 + + /* ++ * Indicates that ctime should not be updated in ext3_xattr_set_handle() ++ */ ++#ifndef XATTR_NO_CTIME ++#define XATTR_NO_CTIME 0x80 ++#endif ++ ++/* + * Function prototypes + */ + +Index: linux-2.6.22.14/fs/ext3/xattr.c +=================================================================== +--- linux-2.6.22.14.orig/fs/ext3/xattr.c ++++ linux-2.6.22.14/fs/ext3/xattr.c +@@ -1039,7 +1039,8 @@ ext3_xattr_set_handle(handle_t *handle, + } + if (!error) { + ext3_xattr_update_super_block(handle, inode->i_sb); +- inode->i_ctime = ext3_current_time(inode); ++ if (!(flags & XATTR_NO_CTIME)) ++ inode->i_ctime = ext3_current_time(inode); + error = ext3_mark_iloc_dirty(handle, inode, &is.iloc); + if (!value) + EXT3_I(inode)->i_state &= ~EXT3_STATE_NO_EXPAND; diff --git a/ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-rhel4.patch b/ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-rhel4.patch new file mode 100644 index 0000000..b9e1802 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-rhel4.patch @@ -0,0 +1,65 @@ +Index: linux-2.6.9-67.0.20/include/linux/ext3_fs.h +=================================================================== +--- linux-2.6.9-67.0.20.orig/include/linux/ext3_fs.h ++++ linux-2.6.9-67.0.20/include/linux/ext3_fs.h +@@ -873,6 +873,13 @@ struct mmp_struct { + #define EXT3_MMP_MIN_CHECK_INTERVAL 5 + + /* ++ * Indicates that ctime should not be updated in ext3_xattr_set_handle() ++ */ ++#ifndef XATTR_NO_CTIME ++#define XATTR_NO_CTIME 0x80 ++#endif ++ ++/* + * Function prototypes + */ + +Index: linux-2.6.9-67.0.20/fs/ext3/xattr.c +=================================================================== +--- linux-2.6.9-67.0.20.orig/fs/ext3/xattr.c ++++ linux-2.6.9-67.0.20/fs/ext3/xattr.c +@@ -91,7 +91,7 @@ + + static int ext3_xattr_set_handle2(handle_t *, struct inode *, + struct buffer_head *, +- struct ext3_xattr_header *); ++ struct ext3_xattr_header *, int); + + static int ext3_xattr_cache_insert(struct buffer_head *); + static struct buffer_head *ext3_xattr_cache_find(handle_t *, struct inode *, +@@ -1215,12 +1215,12 @@ skip_replace: + /* This block is now empty. */ + if (bh && header == HDR(bh)) + unlock_buffer(bh); /* we were modifying in-place. */ +- error = ext3_xattr_set_handle2(handle, inode, bh, NULL); ++ error = ext3_xattr_set_handle2(handle, inode, bh, NULL, flags); + } else { + ext3_xattr_rehash(header, here); + if (bh && header == HDR(bh)) + unlock_buffer(bh); /* we were modifying in-place. */ +- error = ext3_xattr_set_handle2(handle, inode, bh, header); ++ error = ext3_xattr_set_handle2(handle, inode, bh, header, flags); + } + + cleanup: +@@ -1237,7 +1237,7 @@ cleanup: + static int + ext3_xattr_set_handle2(handle_t *handle, struct inode *inode, + struct buffer_head *old_bh, +- struct ext3_xattr_header *header) ++ struct ext3_xattr_header *header, int flags) + { + struct super_block *sb = inode->i_sb; + struct buffer_head *new_bh = NULL; +@@ -1311,7 +1311,8 @@ getblk_failed: + + /* Update the inode. */ + EXT3_I(inode)->i_file_acl = new_bh ? new_bh->b_blocknr : 0; +- inode->i_ctime = ext3_current_time(inode); ++ if (!(flags & XATTR_NO_CTIME)) ++ inode->i_ctime = ext3_current_time(inode); + ext3_mark_inode_dirty(handle, inode); + if (IS_SYNC(inode)) + handle->h_sync = 1; diff --git a/ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-suse.patch b/ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-suse.patch new file mode 100644 index 0000000..6301584 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-xattr-no-update-ctime-suse.patch @@ -0,0 +1,59 @@ +Index: linux-2.6.5-7.311/include/linux/ext3_fs.h +=================================================================== +--- linux-2.6.5-7.311.orig/include/linux/ext3_fs.h ++++ linux-2.6.5-7.311/include/linux/ext3_fs.h +@@ -752,6 +752,13 @@ struct dir_private_info { + #define ERR_BAD_DX_DIR -75000 + + /* ++ * Indicates that ctime should not be updated in ext3_xattr_set_handle() ++ */ ++#ifndef XATTR_NO_CTIME ++#define XATTR_NO_CTIME 0x80 ++#endif ++ ++/* + * Function prototypes + */ + +Index: linux-2.6.5-7.311/fs/ext3/xattr.c +=================================================================== +--- linux-2.6.5-7.311.orig/fs/ext3/xattr.c ++++ linux-2.6.5-7.311/fs/ext3/xattr.c +@@ -89,7 +89,7 @@ + + static int ext3_xattr_set_handle2(handle_t *, struct inode *, + struct buffer_head *, +- struct ext3_xattr_header *); ++ struct ext3_xattr_header *, int); + + static int ext3_xattr_cache_insert(struct buffer_head *); + static struct buffer_head *ext3_xattr_cache_find(struct inode *, +@@ -1302,7 +1302,7 @@ skip_replace: + } + error = ext3_xattr_set_handle2(handle, inode, bh, + IS_LAST_ENTRY(ENTRY(header+1)) ? +- NULL : header); ++ NULL : header, flags); + + cleanup: + brelse(bh); +@@ -1318,7 +1318,7 @@ cleanup: + static int + ext3_xattr_set_handle2(handle_t *handle, struct inode *inode, + struct buffer_head *old_bh, +- struct ext3_xattr_header *header) ++ struct ext3_xattr_header *header, int flags) + { + struct super_block *sb = inode->i_sb; + struct buffer_head *new_bh = NULL; +@@ -1401,7 +1401,8 @@ getblk_failed: + + /* Update the inode. */ + EXT3_I(inode)->i_file_acl = new_bh ? new_bh->b_blocknr : 0; +- inode->i_ctime = CURRENT_TIME; ++ if (!(flags & XATTR_NO_CTIME)) ++ inode->i_ctime = CURRENT_TIME; + ext3_mark_inode_dirty(handle, inode); + if (IS_SYNC(inode)) + handle->h_sync = 1; -- 1.8.3.1