Whamcloud - gitweb
b=14596
authorkalpak <kalpak>
Sun, 13 Jan 2008 08:39:36 +0000 (08:39 +0000)
committerkalpak <kalpak>
Sun, 13 Jan 2008 08:39:36 +0000 (08:39 +0000)
i=adilger, johann

correction for deadlock in ext3_expand_extra_isize

ldiskfs/ChangeLog
ldiskfs/kernel_patches/patches/ext3-inode-version-2.6-sles10.patch
ldiskfs/kernel_patches/patches/ext3-inode-version-2.6.18-vanilla.patch
ldiskfs/kernel_patches/patches/ext3-nanosecond-2.6-sles10.patch

index b4a4e1f..3f01f4a 100644 (file)
@@ -7,6 +7,13 @@ Description: Kernel BUG at ... ldiskfs/ldiskfs/mballoc.c:3853
 Details    : Removing the underlying device (e.g. via a SCSI rescan) can cause a
             kernel BUG in ldiskfs_mb_discard_inode_preallocations().
 
+Severity   : major
+Bugzilla   : 14596
+Description: deadlock in ext3_expand_extra_isize
+Details    : Inode expansion during ext3_mark_inode_dirty may lead to deadlock.
+            This is solved by making sure that ext3_expand_extra_isize isn't
+            called from ext3_xattr_set_handle.
+
 --------------------------------------------------------------------------------
 
 2008-01-11  Sun Microsystems, Inc.
index 7b6b1b8..2514498 100644 (file)
@@ -1,8 +1,8 @@
-Index: linux-2.6.16-sles10/fs/ext3/inode.c
+Index: linux-2.6.16.54-0.2.3/fs/ext3/inode.c
 ===================================================================
---- linux-2.6.16-sles10.orig/fs/ext3/inode.c
-+++ linux-2.6.16-sles10/fs/ext3/inode.c
-@@ -2558,6 +2558,13 @@ void ext3_read_inode(struct inode * inod
+--- linux-2.6.16.54-0.2.3.orig/fs/ext3/inode.c
++++ linux-2.6.16.54-0.2.3/fs/ext3/inode.c
+@@ -2561,6 +2561,13 @@ void ext3_read_inode(struct inode * inod
        EXT3_INODE_GET_XTIME(i_atime, inode, raw_inode);
        EXT3_EINODE_GET_XTIME(i_crtime, ei, raw_inode);
  
@@ -16,7 +16,7 @@ Index: linux-2.6.16-sles10/fs/ext3/inode.c
        if (S_ISREG(inode->i_mode)) {
                inode->i_op = &ext3_file_inode_operations;
                inode->i_fop = &ext3_file_operations;
-@@ -2696,8 +2703,14 @@ static int ext3_do_update_inode(handle_t
+@@ -2699,8 +2706,14 @@ static int ext3_do_update_inode(handle_t
        } else for (block = 0; block < EXT3_N_BLOCKS; block++)
                raw_inode->i_block[block] = ei->i_data[block];
  
@@ -32,7 +32,7 @@ Index: linux-2.6.16-sles10/fs/ext3/inode.c
  
        BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
        rc = ext3_journal_dirty_metadata(handle, bh);
-@@ -2971,10 +2984,32 @@ ext3_reserve_inode_write(handle_t *handl
+@@ -2974,10 +2987,32 @@ ext3_reserve_inode_write(handle_t *handl
  int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode)
  {
        struct ext3_iloc iloc;
@@ -66,11 +66,11 @@ Index: linux-2.6.16-sles10/fs/ext3/inode.c
        if (!err)
                err = ext3_mark_iloc_dirty(handle, inode, &iloc);
        return err;
-Index: linux-2.6.16-sles10/include/linux/ext3_fs.h
+Index: linux-2.6.16.54-0.2.3/include/linux/ext3_fs.h
 ===================================================================
---- linux-2.6.16-sles10.orig/include/linux/ext3_fs.h
-+++ linux-2.6.16-sles10/include/linux/ext3_fs.h
-@@ -205,6 +205,7 @@ struct ext3_group_desc
+--- linux-2.6.16.54-0.2.3.orig/include/linux/ext3_fs.h
++++ linux-2.6.16.54-0.2.3/include/linux/ext3_fs.h
+@@ -227,6 +227,7 @@ struct ext3_group_desc
  #define EXT3_STATE_JDATA              0x00000001 /* journaled data exists */
  #define EXT3_STATE_NEW                        0x00000002 /* inode is newly created */
  #define EXT3_STATE_XATTR              0x00000004 /* has in-inode xattrs */
@@ -78,7 +78,7 @@ Index: linux-2.6.16-sles10/include/linux/ext3_fs.h
  
  /* Used to pass group descriptor data when online resize is done */
  struct ext3_new_group_input {
-@@ -281,7 +282,7 @@ struct ext3_inode {
+@@ -303,7 +304,7 @@ struct ext3_inode {
        __le32  i_flags;        /* File flags */
        union {
                struct {
@@ -87,7 +87,7 @@ Index: linux-2.6.16-sles10/include/linux/ext3_fs.h
                } linux1;
                struct {
                        __u32  h_i_translator;
-@@ -326,6 +327,7 @@ struct ext3_inode {
+@@ -348,6 +349,7 @@ struct ext3_inode {
        __le32  i_atime_extra;  /* extra Access time      (nsec << 2 | epoch) */
        __le32  i_crtime;       /* File Creation time */
        __le32  i_crtime_extra; /* extra File Creation time (nsec << 2 | epoch) */
@@ -95,7 +95,7 @@ Index: linux-2.6.16-sles10/include/linux/ext3_fs.h
  };
  
  #define i_size_high   i_dir_acl
-@@ -388,6 +390,8 @@ do {                                                                        \
+@@ -410,6 +412,8 @@ do {                                                                        \
                                      raw_inode->xtime ## _extra);       \
  } while (0)
  
@@ -104,10 +104,10 @@ Index: linux-2.6.16-sles10/include/linux/ext3_fs.h
  #if defined(__KERNEL__) || defined(__linux__)
  #define i_reserved1   osd1.linux1.l_i_reserved1
  #define i_frag                osd2.linux2.l_i_frag
-Index: linux-2.6.16-sles10/include/linux/ext3_fs_i.h
+Index: linux-2.6.16.54-0.2.3/include/linux/ext3_fs_i.h
 ===================================================================
---- linux-2.6.16-sles10.orig/include/linux/ext3_fs_i.h
-+++ linux-2.6.16-sles10/include/linux/ext3_fs_i.h
+--- linux-2.6.16.54-0.2.3.orig/include/linux/ext3_fs_i.h
++++ linux-2.6.16.54-0.2.3/include/linux/ext3_fs_i.h
 @@ -20,6 +20,8 @@
  #include <linux/rbtree.h>
  #include <linux/seqlock.h>
@@ -117,8 +117,8 @@ Index: linux-2.6.16-sles10/include/linux/ext3_fs_i.h
  struct ext3_reserve_window {
        __u32                   _rsv_start;     /* First byte reserved */
        __u32                   _rsv_end;       /* Last byte reserved or 0 */
-@@ -138,6 +140,8 @@ struct ext3_inode_info {
-       __u32 i_cached_extent[4];
+@@ -142,6 +144,8 @@ struct ext3_inode_info {
+       spinlock_t i_prealloc_lock;
  
        void *i_filterdata;
 +
@@ -126,10 +126,10 @@ Index: linux-2.6.16-sles10/include/linux/ext3_fs_i.h
  };
  
  #endif        /* _LINUX_EXT3_FS_I */
-Index: linux-2.6.16-sles10/fs/ext3/xattr.c
+Index: linux-2.6.16.54-0.2.3/fs/ext3/xattr.c
 ===================================================================
---- linux-2.6.16-sles10.orig/fs/ext3/xattr.c
-+++ linux-2.6.16-sles10/fs/ext3/xattr.c
+--- linux-2.6.16.54-0.2.3.orig/fs/ext3/xattr.c
++++ linux-2.6.16.54-0.2.3/fs/ext3/xattr.c
 @@ -505,6 +505,20 @@ ext3_xattr_release_block(handle_t *handl
        }
  }
@@ -151,16 +151,44 @@ Index: linux-2.6.16-sles10/fs/ext3/xattr.c
  struct ext3_xattr_info {
        int name_index;
        const char *name;
-@@ -1007,6 +1021,8 @@ ext3_xattr_set_handle(handle_t *handle, 
-       if (!error) {
+@@ -944,13 +958,18 @@ ext3_xattr_set_handle(handle_t *handle, 
+       struct ext3_xattr_block_find bs = {
+               .s = { .not_found = -ENODATA, },
+       };
++      unsigned long no_expand;
+       int error;
+       if (!name)
+               return -EINVAL;
+       if (strlen(name) > 255)
+               return -ERANGE;
++
+       down_write(&EXT3_I(inode)->xattr_sem);
++      no_expand = EXT3_I(inode)->i_state & EXT3_STATE_NO_EXPAND;
++      EXT3_I(inode)->i_state |= EXT3_STATE_NO_EXPAND;
++
+       error = ext3_get_inode_loc(inode, &is.iloc);
+       if (error)
+               goto cleanup;
+@@ -1008,6 +1027,8 @@ ext3_xattr_set_handle(handle_t *handle, 
                ext3_xattr_update_super_block(handle, inode->i_sb);
                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;
-               ext3_mark_inode_dirty(handle, inode);
                /*
                 * The bh is consumed by ext3_mark_iloc_dirty, even with
-@@ -1059,6 +1075,249 @@ retry:
+                * error != 0.
+@@ -1020,6 +1041,8 @@ ext3_xattr_set_handle(handle_t *handle, 
+ cleanup:
+       brelse(is.iloc.bh);
+       brelse(bs.bh);
++      if (no_expand == 0)
++              EXT3_I(inode)->i_state &= ~EXT3_STATE_NO_EXPAND;
+       up_write(&EXT3_I(inode)->xattr_sem);
+       return error;
+ }
+@@ -1059,6 +1082,249 @@ retry:
        return error;
  }
  
@@ -410,10 +438,10 @@ Index: linux-2.6.16-sles10/fs/ext3/xattr.c
  /*
   * ext3_xattr_delete_inode()
   *
-Index: linux-2.6.16-sles10/fs/ext3/xattr.h
+Index: linux-2.6.16.54-0.2.3/fs/ext3/xattr.h
 ===================================================================
---- linux-2.6.16-sles10.orig/fs/ext3/xattr.h
-+++ linux-2.6.16-sles10/fs/ext3/xattr.h
+--- linux-2.6.16.54-0.2.3.orig/fs/ext3/xattr.h
++++ linux-2.6.16.54-0.2.3/fs/ext3/xattr.h
 @@ -75,6 +75,9 @@ extern int ext3_xattr_set_handle(handle_
  extern void ext3_xattr_delete_inode(handle_t *, struct inode *);
  extern void ext3_xattr_put_super(struct super_block *);
index 26f71ac..249a1e0 100644 (file)
@@ -2,7 +2,7 @@ Index: linux-2.6.18/fs/ext3/inode.c
 ===================================================================
 --- linux-2.6.18.orig/fs/ext3/inode.c
 +++ linux-2.6.18/fs/ext3/inode.c
-@@ -2703,6 +2703,13 @@ void ext3_read_inode(struct inode * inod
+@@ -2690,6 +2690,13 @@ void ext3_read_inode(struct inode * inod
        EXT3_INODE_GET_XTIME(i_atime, inode, raw_inode);
        EXT3_EINODE_GET_XTIME(i_crtime, ei, raw_inode);
  
@@ -16,7 +16,7 @@ Index: linux-2.6.18/fs/ext3/inode.c
        if (S_ISREG(inode->i_mode)) {
                inode->i_op = &ext3_file_inode_operations;
                inode->i_fop = &ext3_file_operations;
-@@ -2841,8 +2848,14 @@ static int ext3_do_update_inode(handle_t
+@@ -2828,8 +2835,14 @@ static int ext3_do_update_inode(handle_t
        } else for (block = 0; block < EXT3_N_BLOCKS; block++)
                raw_inode->i_block[block] = ei->i_data[block];
  
@@ -32,7 +32,7 @@ Index: linux-2.6.18/fs/ext3/inode.c
  
        BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
        rc = ext3_journal_dirty_metadata(handle, bh);
-@@ -3116,10 +3129,32 @@ ext3_reserve_inode_write(handle_t *handl
+@@ -3103,10 +3116,32 @@ ext3_reserve_inode_write(handle_t *handl
  int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode)
  {
        struct ext3_iloc iloc;
@@ -70,7 +70,7 @@ Index: linux-2.6.18/include/linux/ext3_fs.h
 ===================================================================
 --- linux-2.6.18.orig/include/linux/ext3_fs.h
 +++ linux-2.6.18/include/linux/ext3_fs.h
-@@ -201,6 +201,7 @@ struct ext3_group_desc
+@@ -224,6 +224,7 @@ struct ext3_group_desc
  #define EXT3_STATE_JDATA              0x00000001 /* journaled data exists */
  #define EXT3_STATE_NEW                        0x00000002 /* inode is newly created */
  #define EXT3_STATE_XATTR              0x00000004 /* has in-inode xattrs */
@@ -78,7 +78,7 @@ Index: linux-2.6.18/include/linux/ext3_fs.h
  
  /* Used to pass group descriptor data when online resize is done */
  struct ext3_new_group_input {
-@@ -277,7 +278,7 @@ struct ext3_inode {
+@@ -297,7 +298,7 @@ struct ext3_inode {
        __le32  i_flags;        /* File flags */
        union {
                struct {
@@ -87,7 +87,7 @@ Index: linux-2.6.18/include/linux/ext3_fs.h
                } linux1;
                struct {
                        __u32  h_i_translator;
-@@ -322,6 +323,7 @@ struct ext3_inode {
+@@ -342,6 +343,7 @@ struct ext3_inode {
        __le32  i_atime_extra;  /* extra Access time      (nsec << 2 | epoch) */
        __le32  i_crtime;       /* File Creation time */
        __le32  i_crtime_extra; /* extra File Creation time (nsec << 2 | epoch) */
@@ -95,7 +95,7 @@ Index: linux-2.6.18/include/linux/ext3_fs.h
  };
  
  #define i_size_high   i_dir_acl
-@@ -384,6 +386,8 @@ do {                                                                              \
+@@ -404,6 +406,8 @@ do {                                                                              \
                                       raw_inode->xtime ## _extra);            \
  } while (0)
  
@@ -117,8 +117,8 @@ Index: linux-2.6.18/include/linux/ext3_fs_i.h
  /* data type for block offset of block group */
  typedef int ext3_grpblk_t;
  
-@@ -147,6 +149,8 @@ struct ext3_inode_info {
-       struct timespec i_crtime;
+@@ -162,6 +164,8 @@ struct ext3_inode_info {
+       spinlock_t i_prealloc_lock;
  
        void *i_filterdata;
 +
@@ -151,16 +151,44 @@ Index: linux-2.6.18/fs/ext3/xattr.c
  struct ext3_xattr_info {
        int name_index;
        const char *name;
-@@ -1008,6 +1022,8 @@ ext3_xattr_set_handle(handle_t *handle, 
-       if (!error) {
+@@ -945,13 +959,18 @@ ext3_xattr_set_handle(handle_t *handle, 
+       struct ext3_xattr_block_find bs = {
+               .s = { .not_found = -ENODATA, },
+       };
++      unsigned long no_expand;
+       int error;
+       if (!name)
+               return -EINVAL;
+       if (strlen(name) > 255)
+               return -ERANGE;
++
+       down_write(&EXT3_I(inode)->xattr_sem);
++      no_expand = EXT3_I(inode)->i_state & EXT3_STATE_NO_EXPAND;
++      EXT3_I(inode)->i_state |= EXT3_STATE_NO_EXPAND;
++
+       error = ext3_get_inode_loc(inode, &is.iloc);
+       if (error)
+               goto cleanup;
+@@ -1009,6 +1028,8 @@ ext3_xattr_set_handle(handle_t *handle, 
                ext3_xattr_update_super_block(handle, inode->i_sb);
                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;
-               error = ext3_mark_iloc_dirty(handle, inode, &is.iloc);
                /*
                 * The bh is consumed by ext3_mark_iloc_dirty, even with
-@@ -1060,6 +1076,249 @@ retry:
+                * error != 0.
+@@ -1021,6 +1042,8 @@ ext3_xattr_set_handle(handle_t *handle, 
+ cleanup:
+       brelse(is.iloc.bh);
+       brelse(bs.bh);
++      if (no_expand == 0)
++              EXT3_I(inode)->i_state &= ~EXT3_STATE_NO_EXPAND;
+       up_write(&EXT3_I(inode)->xattr_sem);
+       return error;
+ }
+@@ -1060,6 +1083,249 @@ retry:
        return error;
  }
  
index 04c6e61..0417b60 100644 (file)
@@ -1,8 +1,8 @@
-Index: linux-2.6.16.27-0.9/fs/ext3/ialloc.c
+Index: linux-2.6.16.54-0.2.3/fs/ext3/ialloc.c
 ===================================================================
---- linux-2.6.16.27-0.9.orig/fs/ext3/ialloc.c
-+++ linux-2.6.16.27-0.9/fs/ext3/ialloc.c
-@@ -577,7 +577,8 @@ got:
+--- linux-2.6.16.54-0.2.3.orig/fs/ext3/ialloc.c
++++ linux-2.6.16.54-0.2.3/fs/ext3/ialloc.c
+@@ -727,7 +727,8 @@ got:
        /* This is the optimal IO size (for stat), not the fs block size */
        inode->i_blksize = PAGE_SIZE;
        inode->i_blocks = 0;
@@ -12,7 +12,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/ialloc.c
  
        memset(ei->i_data, 0, sizeof(ei->i_data));
        ei->i_dir_start_lookup = 0;
-@@ -609,9 +610,8 @@ got:
+@@ -759,9 +760,8 @@ got:
        spin_unlock(&sbi->s_next_gen_lock);
  
        ei->i_state = EXT3_STATE_NEW;
@@ -24,11 +24,11 @@ Index: linux-2.6.16.27-0.9/fs/ext3/ialloc.c
  
        ret = inode;
        if(DQUOT_ALLOC_INODE(inode)) {
-Index: linux-2.6.16.27-0.9/fs/ext3/inode.c
+Index: linux-2.6.16.54-0.2.3/fs/ext3/inode.c
 ===================================================================
---- linux-2.6.16.27-0.9.orig/fs/ext3/inode.c
-+++ linux-2.6.16.27-0.9/fs/ext3/inode.c
-@@ -620,7 +620,7 @@ static int ext3_splice_branch(handle_t *
+--- linux-2.6.16.54-0.2.3.orig/fs/ext3/inode.c
++++ linux-2.6.16.54-0.2.3/fs/ext3/inode.c
+@@ -621,7 +621,7 @@ static int ext3_splice_branch(handle_t *
  
        /* We are done with atomic stuff, now do the rest of housekeeping */
  
@@ -37,7 +37,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/inode.c
        ext3_mark_inode_dirty(handle, inode);
  
        /* had we spliced it onto indirect block? */
-@@ -2244,7 +2244,7 @@ do_indirects:
+@@ -2248,7 +2248,7 @@ do_indirects:
        ext3_discard_reservation(inode);
  
        up(&ei->truncate_sem);
@@ -46,7 +46,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/inode.c
        ext3_mark_inode_dirty(handle, inode);
  
        /* In a multi-transaction truncate, we only make the final
-@@ -2479,10 +2479,6 @@ void ext3_read_inode(struct inode * inod
+@@ -2482,10 +2482,6 @@ void ext3_read_inode(struct inode * inod
        }
        inode->i_nlink = le16_to_cpu(raw_inode->i_links_count);
        inode->i_size = le32_to_cpu(raw_inode->i_size);
@@ -57,7 +57,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/inode.c
  
        ei->i_state = 0;
        ei->i_dir_start_lookup = 0;
-@@ -2557,6 +2553,11 @@ void ext3_read_inode(struct inode * inod
+@@ -2560,6 +2556,11 @@ void ext3_read_inode(struct inode * inod
        } else
                ei->i_extra_isize = 0;
  
@@ -69,7 +69,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/inode.c
        if (S_ISREG(inode->i_mode)) {
                inode->i_op = &ext3_file_inode_operations;
                inode->i_fop = &ext3_file_operations;
-@@ -2637,9 +2638,12 @@ static int ext3_do_update_inode(handle_t
+@@ -2640,9 +2641,12 @@ static int ext3_do_update_inode(handle_t
        }
        raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
        raw_inode->i_size = cpu_to_le32(ei->i_disksize);
@@ -85,11 +85,11 @@ Index: linux-2.6.16.27-0.9/fs/ext3/inode.c
        raw_inode->i_blocks = cpu_to_le32(inode->i_blocks);
        raw_inode->i_dtime = cpu_to_le32(ei->i_dtime);
        raw_inode->i_flags = cpu_to_le32(ei->i_flags);
-Index: linux-2.6.16.27-0.9/fs/ext3/ioctl.c
+Index: linux-2.6.16.54-0.2.3/fs/ext3/ioctl.c
 ===================================================================
---- linux-2.6.16.27-0.9.orig/fs/ext3/ioctl.c
-+++ linux-2.6.16.27-0.9/fs/ext3/ioctl.c
-@@ -88,7 +88,7 @@ int ext3_ioctl (struct inode * inode, st
+--- linux-2.6.16.54-0.2.3.orig/fs/ext3/ioctl.c
++++ linux-2.6.16.54-0.2.3/fs/ext3/ioctl.c
+@@ -114,7 +114,7 @@ int ext3_ioctl (struct inode * inode, st
                ei->i_flags = flags;
  
                ext3_set_inode_flags(inode);
@@ -98,7 +98,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/ioctl.c
  
                err = ext3_mark_iloc_dirty(handle, inode, &iloc);
  flags_err:
-@@ -126,7 +126,7 @@ flags_err:
+@@ -152,7 +152,7 @@ flags_err:
                        return PTR_ERR(handle);
                err = ext3_reserve_inode_write(handle, inode, &iloc);
                if (err == 0) {
@@ -107,11 +107,11 @@ Index: linux-2.6.16.27-0.9/fs/ext3/ioctl.c
                        inode->i_generation = generation;
                        err = ext3_mark_iloc_dirty(handle, inode, &iloc);
                }
-Index: linux-2.6.16.27-0.9/fs/ext3/namei.c
+Index: linux-2.6.16.54-0.2.3/fs/ext3/namei.c
 ===================================================================
---- linux-2.6.16.27-0.9.orig/fs/ext3/namei.c
-+++ linux-2.6.16.27-0.9/fs/ext3/namei.c
-@@ -1276,7 +1276,7 @@ static int add_dirent_to_buf(handle_t *h
+--- linux-2.6.16.54-0.2.3.orig/fs/ext3/namei.c
++++ linux-2.6.16.54-0.2.3/fs/ext3/namei.c
+@@ -1296,7 +1296,7 @@ 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.
         */
@@ -120,7 +120,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/namei.c
        ext3_update_dx_flag(dir);
        dir->i_version++;
        ext3_mark_inode_dirty(handle, dir);
-@@ -2056,7 +2056,7 @@ static int ext3_rmdir (struct inode * di
+@@ -2090,7 +2090,7 @@ static int ext3_rmdir (struct inode * di
        inode->i_version++;
        inode->i_nlink = 0;
        ext3_orphan_add(handle, inode);
@@ -129,7 +129,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/namei.c
        ext3_mark_inode_dirty(handle, inode);
        ext3_dec_count(handle, dir);
        ext3_update_dx_flag(dir);
-@@ -2106,13 +2106,13 @@ static int ext3_unlink(struct inode * di
+@@ -2140,13 +2140,13 @@ static int ext3_unlink(struct inode * di
        retval = ext3_delete_entry(handle, dir, de, bh);
        if (retval)
                goto end_unlink;
@@ -145,7 +145,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/namei.c
        ext3_mark_inode_dirty(handle, inode);
        retval = 0;
  
-@@ -2214,7 +2214,7 @@ retry:
+@@ -2248,7 +2248,7 @@ retry:
        if (IS_DIRSYNC(dir))
                handle->h_sync = 1;
  
@@ -154,7 +154,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/namei.c
        ext3_inc_count(handle, inode);
        atomic_inc(&inode->i_count);
  
-@@ -2317,7 +2317,7 @@ static int ext3_rename (struct inode * o
+@@ -2351,7 +2351,7 @@ static int ext3_rename (struct inode * o
         * Like most other Unix systems, set the ctime for inodes on a
         * rename.
         */
@@ -163,7 +163,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/namei.c
        ext3_mark_inode_dirty(handle, old_inode);
  
        /*
-@@ -2350,9 +2350,9 @@ static int ext3_rename (struct inode * o
+@@ -2384,9 +2384,9 @@ static int ext3_rename (struct inode * o
  
        if (new_inode) {
                ext3_dec_count(handle, new_inode);
@@ -175,11 +175,11 @@ Index: linux-2.6.16.27-0.9/fs/ext3/namei.c
        ext3_update_dx_flag(old_dir);
        if (dir_bh) {
                BUFFER_TRACE(dir_bh, "get_write_access");
-Index: linux-2.6.16.27-0.9/fs/ext3/super.c
+Index: linux-2.6.16.54-0.2.3/fs/ext3/super.c
 ===================================================================
---- linux-2.6.16.27-0.9.orig/fs/ext3/super.c
-+++ linux-2.6.16.27-0.9/fs/ext3/super.c
-@@ -1614,6 +1614,8 @@ static int ext3_fill_super (struct super
+--- linux-2.6.16.54-0.2.3.orig/fs/ext3/super.c
++++ linux-2.6.16.54-0.2.3/fs/ext3/super.c
+@@ -1709,6 +1709,8 @@ static int ext3_fill_super (struct super
                                sbi->s_inode_size);
                        goto failed_mount;
                }
@@ -188,7 +188,7 @@ Index: linux-2.6.16.27-0.9/fs/ext3/super.c
        }
        sbi->s_frag_size = EXT3_MIN_FRAG_SIZE <<
                                   le32_to_cpu(es->s_log_frag_size);
-@@ -1809,6 +1811,32 @@ static int ext3_fill_super (struct super
+@@ -1904,6 +1906,32 @@ static int ext3_fill_super (struct super
        }
  
        ext3_setup_super (sb, es, sb->s_flags & MS_RDONLY);
@@ -221,26 +221,24 @@ Index: linux-2.6.16.27-0.9/fs/ext3/super.c
        /*
         * akpm: core read_super() calls in here with the superblock locked.
         * That deadlocks, because orphan cleanup needs to lock the superblock
-Index: linux-2.6.16.27-0.9/fs/ext3/xattr.c
+Index: linux-2.6.16.54-0.2.3/fs/ext3/xattr.c
 ===================================================================
---- linux-2.6.16.27-0.9.orig/fs/ext3/xattr.c
-+++ linux-2.6.16.27-0.9/fs/ext3/xattr.c
-@@ -1006,8 +1006,8 @@ ext3_xattr_set_handle(handle_t *handle, 
+--- linux-2.6.16.54-0.2.3.orig/fs/ext3/xattr.c
++++ linux-2.6.16.54-0.2.3/fs/ext3/xattr.c
+@@ -1006,7 +1006,7 @@ ext3_xattr_set_handle(handle_t *handle, 
        }
        if (!error) {
                ext3_xattr_update_super_block(handle, inode->i_sb);
 -              inode->i_ctime = CURRENT_TIME_SEC;
--              error = ext3_mark_iloc_dirty(handle, inode, &is.iloc);
 +              inode->i_ctime = ext3_current_time(inode);
-+              ext3_mark_inode_dirty(handle, inode);
+               error = ext3_mark_iloc_dirty(handle, inode, &is.iloc);
                /*
                 * The bh is consumed by ext3_mark_iloc_dirty, even with
-                * error != 0.
-Index: linux-2.6.16.27-0.9/include/linux/ext3_fs.h
+Index: linux-2.6.16.54-0.2.3/include/linux/ext3_fs.h
 ===================================================================
---- linux-2.6.16.27-0.9.orig/include/linux/ext3_fs.h
-+++ linux-2.6.16.27-0.9/include/linux/ext3_fs.h
-@@ -272,7 +272,7 @@ struct ext3_inode {
+--- linux-2.6.16.54-0.2.3.orig/include/linux/ext3_fs.h
++++ linux-2.6.16.54-0.2.3/include/linux/ext3_fs.h
+@@ -294,7 +294,7 @@ struct ext3_inode {
        __le16  i_uid;          /* Low 16 bits of Owner Uid */
        __le32  i_size;         /* Size in bytes */
        __le32  i_atime;        /* Access time */
@@ -249,7 +247,7 @@ Index: linux-2.6.16.27-0.9/include/linux/ext3_fs.h
        __le32  i_mtime;        /* Modification time */
        __le32  i_dtime;        /* Deletion Time */
        __le16  i_gid;          /* Low 16 bits of Group Id */
-@@ -321,10 +321,73 @@ struct ext3_inode {
+@@ -343,10 +343,73 @@ struct ext3_inode {
        } osd2;                         /* OS dependent 2 */
        __le16  i_extra_isize;
        __le16  i_pad1;
@@ -323,7 +321,7 @@ Index: linux-2.6.16.27-0.9/include/linux/ext3_fs.h
  #if defined(__KERNEL__) || defined(__linux__)
  #define i_reserved1   osd1.linux1.l_i_reserved1
  #define i_frag                osd2.linux2.l_i_frag
-@@ -504,11 +567,19 @@ struct ext3_super_block {
+@@ -526,11 +589,19 @@ struct ext3_super_block {
        __le32  s_last_orphan;          /* start of list of inodes to delete */
        __le32  s_hash_seed[4];         /* HTREE hash seed */
        __u8    s_def_hash_version;     /* Default hash version to use */
@@ -347,7 +345,7 @@ Index: linux-2.6.16.27-0.9/include/linux/ext3_fs.h
  };
  
  #ifdef __KERNEL__
-@@ -583,6 +648,8 @@ static inline struct ext3_inode_info *EX
+@@ -615,6 +686,8 @@ static inline int ext3_valid_inum(struct
  #define EXT3_FEATURE_RO_COMPAT_BTREE_DIR      0x0004
  #define EXT4_FEATURE_RO_COMPAT_GDT_CSUM               0x0010
  #define EXT4_FEATURE_RO_COMPAT_DIR_NLINK      0x0020
@@ -356,7 +354,7 @@ Index: linux-2.6.16.27-0.9/include/linux/ext3_fs.h
  
  #define EXT3_FEATURE_INCOMPAT_COMPRESSION     0x0001
  #define EXT3_FEATURE_INCOMPAT_FILETYPE                0x0002
-@@ -599,6 +666,7 @@ static inline struct ext3_inode_info *EX
+@@ -632,6 +705,7 @@ static inline int ext3_valid_inum(struct
                                         EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
                                         EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \
                                         EXT4_FEATURE_RO_COMPAT_DIR_NLINK| \
@@ -364,7 +362,7 @@ Index: linux-2.6.16.27-0.9/include/linux/ext3_fs.h
                                         EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
  
  /*
-@@ -726,6 +794,12 @@ static inline struct ext3_inode *ext3_ra
+@@ -759,6 +833,12 @@ static inline struct ext3_inode *ext3_ra
        return (struct ext3_inode *) (iloc->bh->b_data + iloc->offset);
  }
  
@@ -377,11 +375,11 @@ Index: linux-2.6.16.27-0.9/include/linux/ext3_fs.h
  /*
   * This structure is stuffed into the struct file's private_data field
   * for directories.  It is where we put information so that we can do
-Index: linux-2.6.16.27-0.9/include/linux/ext3_fs_i.h
+Index: linux-2.6.16.54-0.2.3/include/linux/ext3_fs_i.h
 ===================================================================
---- linux-2.6.16.27-0.9.orig/include/linux/ext3_fs_i.h
-+++ linux-2.6.16.27-0.9/include/linux/ext3_fs_i.h
-@@ -130,6 +130,7 @@ struct ext3_inode_info {
+--- linux-2.6.16.54-0.2.3.orig/include/linux/ext3_fs_i.h
++++ linux-2.6.16.54-0.2.3/include/linux/ext3_fs_i.h
+@@ -120,6 +120,7 @@ struct ext3_inode_info {
  
        /* on-disk additional length */
        __u16 i_extra_isize;
@@ -389,11 +387,11 @@ Index: linux-2.6.16.27-0.9/include/linux/ext3_fs_i.h
  
        /*
         * truncate_sem is for serialising ext3_truncate() against
-Index: linux-2.6.16.27-0.9/include/linux/ext3_fs_sb.h
+Index: linux-2.6.16.54-0.2.3/include/linux/ext3_fs_sb.h
 ===================================================================
---- linux-2.6.16.27-0.9.orig/include/linux/ext3_fs_sb.h
-+++ linux-2.6.16.27-0.9/include/linux/ext3_fs_sb.h
-@@ -71,6 +71,8 @@ struct ext3_sb_info {
+--- linux-2.6.16.54-0.2.3.orig/include/linux/ext3_fs_sb.h
++++ linux-2.6.16.54-0.2.3/include/linux/ext3_fs_sb.h
+@@ -68,6 +68,8 @@ struct ext3_sb_info {
        /* Last group used to allocate inode */
        int s_last_alloc_group;