Whamcloud - gitweb
b=3244
authorkalpak <kalpak>
Mon, 19 Feb 2007 13:48:36 +0000 (13:48 +0000)
committerkalpak <kalpak>
Mon, 19 Feb 2007 13:48:36 +0000 (13:48 +0000)
r=Andreas Dilger

Description: Addition of EXT3_FEATURE_RO_COMPAT_DIR_NLINKS flag for
             > 32000 subdirectories

Details    : Add EXT3_FEATURE_RO_COMPAT_DIR_NLINK flag to
             EXT3_FEATURE_RO_COMPAT_SUPP. This flag will be set whenever
             subdirectory count crosses 32000. This will aid e2fsck to
             correctly handle more than 32000 subdirectories.

ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.7.patch
ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.9.patch
lustre/ChangeLog
lustre/kernel_patches/patches/ext3-nlinks-2.4.20-hp_pnnl.patch
lustre/kernel_patches/patches/ext3-nlinks-2.4.21-chaos.patch
lustre/kernel_patches/patches/ext3-nlinks-2.4.24.patch
lustre/kernel_patches/patches/ext3-nlinks-2.6.7.patch
lustre/kernel_patches/patches/ext3-nlinks-2.6.9.patch

index 0d360fa..a818e62 100644 (file)
@@ -1,8 +1,8 @@
-Index: linux-2.6.7/fs/ext3/namei.c
+Index: linux-2.6.5-7.283/fs/ext3/namei.c
 ===================================================================
---- linux-2.6.7.orig/fs/ext3/namei.c   2004-06-15 23:19:36.000000000 -0600
-+++ linux-2.6.7/fs/ext3/namei.c        2004-08-20 17:48:54.000000000 -0600
-@@ -1596,11 +1596,17 @@ static int ext3_delete_entry (handle_t *
+--- linux-2.6.5-7.283.orig/fs/ext3/namei.c
++++ linux-2.6.5-7.283/fs/ext3/namei.c
+@@ -1613,11 +1613,17 @@ static int ext3_delete_entry (handle_t *
  static inline void ext3_inc_count(handle_t *handle, struct inode *inode)
  {
        inode->i_nlink++;
@@ -21,16 +21,16 @@ Index: linux-2.6.7/fs/ext3/namei.c
  }
  
  static int ext3_add_nondir(handle_t *handle,
-@@ -1693,7 +1698,7 @@ static int ext3_mkdir(struct inode * dir
-       struct ext3_dir_entry_2 * de;
+@@ -1730,7 +1736,7 @@ static int ext3_mkdir(struct inode * dir
+       int retries = 0;
        int err;
  
 -      if (dir->i_nlink >= EXT3_LINK_MAX)
 +      if (EXT3_DIR_LINK_MAX(dir))
                return -EMLINK;
  
-       handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
-@@ -1715,7 +1720,7 @@ static int ext3_mkdir(struct inode * dir
+ retry:
+@@ -1752,7 +1758,7 @@ retry:
        inode->i_size = EXT3_I(inode)->i_disksize = inode->i_sb->s_blocksize;
        dir_block = ext3_bread (handle, inode, 0, 1, &err);
        if (!dir_block) {
@@ -39,7 +39,7 @@ Index: linux-2.6.7/fs/ext3/namei.c
                ext3_mark_inode_dirty(handle, inode);
                iput (inode);
                goto out_stop;
-@@ -1747,7 +1752,7 @@ static int ext3_mkdir(struct inode * dir
+@@ -1784,7 +1790,7 @@ retry:
                iput (inode);
                goto out_stop;
        }
@@ -48,7 +48,7 @@ Index: linux-2.6.7/fs/ext3/namei.c
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
        d_instantiate(dentry, inode);
-@@ -2010,10 +2015,10 @@ static int ext3_rmdir (struct inode * di
+@@ -2042,16 +2048,16 @@ static int ext3_rmdir (struct inode * di
        retval = ext3_delete_entry(handle, dir, de, bh);
        if (retval)
                goto end_rmdir;
@@ -62,8 +62,6 @@ Index: linux-2.6.7/fs/ext3/namei.c
 +                           inode->i_nlink);
        inode->i_version++;
        inode->i_nlink = 0;
-       /* There's no need to set i_disksize: the fact that i_nlink is
-@@ -2023,7 +2028,7 @@ static int ext3_rmdir (struct inode * di
        ext3_orphan_add(handle, inode);
        inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
        ext3_mark_inode_dirty(handle, inode);
@@ -72,7 +70,7 @@ Index: linux-2.6.7/fs/ext3/namei.c
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
  
-@@ -2074,7 +2079,7 @@ static int ext3_unlink(struct inode * di
+@@ -2100,7 +2106,7 @@ static int ext3_unlink(struct inode * di
        dir->i_ctime = dir->i_mtime = CURRENT_TIME;
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
@@ -81,16 +79,16 @@ Index: linux-2.6.7/fs/ext3/namei.c
        if (!inode->i_nlink)
                ext3_orphan_add(handle, inode);
        inode->i_ctime = dir->i_ctime;
-@@ -2146,7 +2151,7 @@ static int ext3_link (struct dentry * ol
+@@ -2191,7 +2197,7 @@ static int ext3_link (struct dentry * ol
        struct inode *inode = old_dentry->d_inode;
-       int err;
+       int err, retries = 0;
  
 -      if (inode->i_nlink >= EXT3_LINK_MAX)
 +      if (EXT3_DIR_LINK_MAX(inode))
                return -EMLINK;
  
-       handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
-@@ -2230,8 +2235,8 @@ static int ext3_rename (struct inode * o
+ retry:
+@@ -2277,8 +2283,8 @@ static int ext3_rename (struct inode * o
                if (le32_to_cpu(PARENT_INO(dir_bh->b_data)) != old_dir->i_ino)
                        goto end_rename;
                retval = -EMLINK;
@@ -101,7 +99,7 @@ Index: linux-2.6.7/fs/ext3/namei.c
                        goto end_rename;
        }
        if (!new_bh) {
-@@ -2288,7 +2293,7 @@ static int ext3_rename (struct inode * o
+@@ -2335,7 +2341,7 @@ static int ext3_rename (struct inode * o
        }
  
        if (new_inode) {
@@ -110,7 +108,7 @@ Index: linux-2.6.7/fs/ext3/namei.c
                new_inode->i_ctime = CURRENT_TIME;
        }
        old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
-@@ -2299,11 +2304,13 @@ static int ext3_rename (struct inode * o
+@@ -2346,11 +2352,13 @@ static int ext3_rename (struct inode * o
                PARENT_INO(dir_bh->b_data) = le32_to_cpu(new_dir->i_ino);
                BUFFER_TRACE(dir_bh, "call ext3_journal_dirty_metadata");
                ext3_journal_dirty_metadata(handle, dir_bh);
@@ -127,11 +125,11 @@ Index: linux-2.6.7/fs/ext3/namei.c
                        ext3_update_dx_flag(new_dir);
                        ext3_mark_inode_dirty(handle, new_dir);
                }
-Index: linux-2.6.7/include/linux/ext3_fs.h
+Index: linux-2.6.5-7.283/include/linux/ext3_fs.h
 ===================================================================
---- linux-2.6.7.orig/include/linux/ext3_fs.h   2004-06-15 23:19:36.000000000 -0600
-+++ linux-2.6.7/include/linux/ext3_fs.h        2004-08-20 17:41:27.000000000 -0600
-@@ -79,7 +81,7 @@
+--- linux-2.6.5-7.283.orig/include/linux/ext3_fs.h
++++ linux-2.6.5-7.283/include/linux/ext3_fs.h
+@@ -86,7 +86,7 @@ struct statfs;
  /*
   * Maximal count of links to a file
   */
@@ -140,3 +138,19 @@ Index: linux-2.6.7/include/linux/ext3_fs.h
  
  /*
   * Macro-instructions used to manage several block sizes
+@@ -538,6 +538,7 @@ static inline struct ext3_inode_info *EX
+ #define EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER   0x0001
+ #define EXT3_FEATURE_RO_COMPAT_LARGE_FILE     0x0002
+ #define EXT3_FEATURE_RO_COMPAT_BTREE_DIR      0x0004
++#define EXT3_FEATURE_RO_COMPAT_DIR_NLINK      0x0020
+ #define EXT3_FEATURE_INCOMPAT_COMPRESSION     0x0001
+ #define EXT3_FEATURE_INCOMPAT_FILETYPE                0x0002
+@@ -553,6 +554,7 @@ static inline struct ext3_inode_info *EX
+                                        EXT3_FEATURE_INCOMPAT_EXTENTS)
+ #define EXT3_FEATURE_RO_COMPAT_SUPP   (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
+                                        EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
++                                       EXT3_FEATURE_RO_COMPAT_DIR_NLINK| \
+                                        EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
+ /*
index 37cca81..147928c 100644 (file)
@@ -1,7 +1,8 @@
-diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
---- orig/fs/ext3/namei.c       2005-10-12 13:58:19.000000000 -0700
-+++ patch/fs/ext3/namei.c      2005-10-12 14:00:33.000000000 -0700
-@@ -1603,11 +1603,17 @@
+Index: linux-2.6.12/fs/ext3/namei.c
+===================================================================
+--- linux-2.6.12.orig/fs/ext3/namei.c
++++ linux-2.6.12/fs/ext3/namei.c
+@@ -1600,11 +1600,17 @@ static int ext3_delete_entry (handle_t *
  static inline void ext3_inc_count(handle_t *handle, struct inode *inode)
  {
        inode->i_nlink++;
@@ -20,7 +21,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
  }
  
  static int ext3_add_nondir(handle_t *handle,
-@@ -1706,7 +1712,7 @@ static int ext3_add_nondir(handle_t
+@@ -1703,7 +1709,7 @@ static int ext3_mkdir(struct inode * dir
        struct ext3_dir_entry_2 * de;
        int err, retries = 0;
  
@@ -29,7 +30,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
                return -EMLINK;
  
  retry:
-@@ -1729,7 +1735,7 @@ static int ext3_mkdir(struct inode
+@@ -1726,7 +1732,7 @@ retry:
        inode->i_size = EXT3_I(inode)->i_disksize = inode->i_sb->s_blocksize;
        dir_block = ext3_bread (handle, inode, 0, 1, &err);
        if (!dir_block) {
@@ -38,7 +39,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
                ext3_mark_inode_dirty(handle, inode);
                iput (inode);
                goto out_stop;
-@@ -1761,7 +1767,7 @@ static int ext3_mkdir(struct inode
+@@ -1758,7 +1764,7 @@ retry:
                iput (inode);
                goto out_stop;
        }
@@ -47,7 +48,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
        d_instantiate(dentry, inode);
-@@ -2026,10 +2032,10 @@ static int ext3_rmdir (struct inode
+@@ -2023,10 +2029,10 @@ static int ext3_rmdir (struct inode * di
        retval = ext3_delete_entry(handle, dir, de, bh);
        if (retval)
                goto end_rmdir;
@@ -62,7 +63,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
        inode->i_version++;
        inode->i_nlink = 0;
        /* There's no need to set i_disksize: the fact that i_nlink is
-@@ -2039,7 +2045,7 @@ static int ext3_rmdir (struct inode
+@@ -2036,7 +2042,7 @@ static int ext3_rmdir (struct inode * di
        ext3_orphan_add(handle, inode);
        inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC;
        ext3_mark_inode_dirty(handle, inode);
@@ -71,7 +72,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
  
-@@ -2090,7 +2096,7 @@ static int ext3_unlink(struct inode
+@@ -2087,7 +2093,7 @@ static int ext3_unlink(struct inode * di
        dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC;
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
@@ -80,7 +81,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
        if (!inode->i_nlink)
                ext3_orphan_add(handle, inode);
        inode->i_ctime = dir->i_ctime;
-@@ -2165,7 +2171,7 @@ static int ext3_link (struct dentry
+@@ -2162,7 +2168,7 @@ static int ext3_link (struct dentry * ol
        struct inode *inode = old_dentry->d_inode;
        int err, retries = 0;
  
@@ -89,7 +90,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
                return -EMLINK;
  
  retry:
-@@ -2252,8 +2258,8 @@ static int ext3_rename (struct inode
+@@ -2249,8 +2255,8 @@ static int ext3_rename (struct inode * o
                if (le32_to_cpu(PARENT_INO(dir_bh->b_data)) != old_dir->i_ino)
                        goto end_rename;
                retval = -EMLINK;
@@ -100,7 +101,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
                        goto end_rename;
        }
        if (!new_bh) {
-@@ -2310,7 +2316,7 @@ static int ext3_rename (struct inode
+@@ -2307,7 +2313,7 @@ static int ext3_rename (struct inode * o
        }
  
        if (new_inode) {
@@ -109,7 +110,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
                new_inode->i_ctime = CURRENT_TIME_SEC;
        }
        old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME_SEC;
-@@ -2321,11 +2327,13 @@ static int ext3_rename (struct inode
+@@ -2318,11 +2324,13 @@ static int ext3_rename (struct inode * o
                PARENT_INO(dir_bh->b_data) = cpu_to_le32(new_dir->i_ino);
                BUFFER_TRACE(dir_bh, "call ext3_journal_dirty_metadata");
                ext3_journal_dirty_metadata(handle, dir_bh);
@@ -126,12 +127,11 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
                        ext3_update_dx_flag(new_dir);
                        ext3_mark_inode_dirty(handle, new_dir);
                }
-
-Index: linux-2.6.7/include/linux/ext3_fs.h
+Index: linux-2.6.12/include/linux/ext3_fs.h
 ===================================================================
---- linux-2.6.7.orig/include/linux/ext3_fs.h   2004-06-15 23:19:36.000000000 -0600
-+++ linux-2.6.7/include/linux/ext3_fs.h        2004-08-20 17:41:27.000000000 -0600
-@@ -79,7 +81,7 @@
+--- linux-2.6.12.orig/include/linux/ext3_fs.h
++++ linux-2.6.12/include/linux/ext3_fs.h
+@@ -78,7 +78,7 @@ struct statfs;
  /*
   * Maximal count of links to a file
   */
@@ -140,3 +140,19 @@ Index: linux-2.6.7/include/linux/ext3_fs.h
  
  /*
   * Macro-instructions used to manage several block sizes
+@@ -539,6 +539,7 @@ static inline struct ext3_inode_info *EX
+ #define EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER   0x0001
+ #define EXT3_FEATURE_RO_COMPAT_LARGE_FILE     0x0002
+ #define EXT3_FEATURE_RO_COMPAT_BTREE_DIR      0x0004
++#define EXT3_FEATURE_RO_COMPAT_DIR_NLINK              0x0020
+ #define EXT3_FEATURE_INCOMPAT_COMPRESSION     0x0001
+ #define EXT3_FEATURE_INCOMPAT_FILETYPE                0x0002
+@@ -552,6 +553,7 @@ static inline struct ext3_inode_info *EX
+                                        EXT3_FEATURE_INCOMPAT_META_BG)
+ #define EXT3_FEATURE_RO_COMPAT_SUPP   (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
+                                        EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
++                                       EXT3_FEATURE_RO_COMPAT_DIR_NLINK| \
+                                        EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
+ /*
index a188c3f..6fbead0 100644 (file)
@@ -295,6 +295,16 @@ Details    : Large single O_DIRECT read and write calls can fail to allocate
             allocation failure the allocation is retried with a smaller
             buffer and broken into smaller requests.
 
+Severity   : normal
+Frequency  : always
+Bugzilla   : 3244
+Description: Addition of EXT3_FEATURE_RO_COMPAT_DIR_NLINKS flag for
+            > 32000 subdirectories
+Details    : Add EXT3_FEATURE_RO_COMPAT_DIR_NLINK flag to 
+             EXT3_FEATURE_RO_COMPAT_SUPP. This flag will be set whenever
+             subdirectory count crosses 32000. This will aid e2fsck to
+             correctly handle more than 32000 subdirectories.
+
 ------------------------------------------------------------------------------
 
 TBD         Cluster File Systems, Inc. <info@clusterfs.com>
index 3273075..40121ae 100644 (file)
@@ -1,8 +1,8 @@
 Index: linux/fs/ext3/namei.c
 ===================================================================
---- linux.orig/fs/ext3/namei.c Wed Aug 25 11:34:25 2004
-+++ linux/fs/ext3/namei.c      Wed Aug 25 13:16:03 2004
-@@ -1541,11 +1541,17 @@
+--- linux.orig/fs/ext3/namei.c
++++ linux/fs/ext3/namei.c
+@@ -1549,11 +1549,17 @@ static int ext3_delete_entry (handle_t *
  static inline void ext3_inc_count(handle_t *handle, struct inode *inode)
  {
        inode->i_nlink++;
@@ -21,7 +21,7 @@ Index: linux/fs/ext3/namei.c
  }
  
  static int ext3_add_nondir(handle_t *handle,
-@@ -1646,7 +1651,7 @@
+@@ -1654,7 +1660,7 @@ static int ext3_mkdir(struct inode * dir
        struct ext3_dir_entry_2 * de;
        int err;
  
@@ -30,7 +30,7 @@ Index: linux/fs/ext3/namei.c
                return -EMLINK;
  
        handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
-@@ -1668,7 +1673,7 @@
+@@ -1676,7 +1682,7 @@ static int ext3_mkdir(struct inode * dir
        inode->i_size = EXT3_I(inode)->i_disksize = inode->i_sb->s_blocksize;
        dir_block = ext3_bread (handle, inode, 0, 1, &err);
        if (!dir_block) {
@@ -39,7 +39,7 @@ Index: linux/fs/ext3/namei.c
                ext3_mark_inode_dirty(handle, inode);
                iput (inode);
                goto out_stop;
-@@ -1700,7 +1705,7 @@
+@@ -1708,7 +1714,7 @@ static int ext3_mkdir(struct inode * dir
                iput (inode);
                goto out_stop;
        }
@@ -48,7 +48,7 @@ Index: linux/fs/ext3/namei.c
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
        d_instantiate(dentry, inode);
-@@ -1761,10 +1766,11 @@
+@@ -1769,10 +1775,11 @@ static int empty_dir (struct inode * ino
                        }
                        de = (struct ext3_dir_entry_2 *) bh->b_data;
                }
@@ -64,7 +64,7 @@ Index: linux/fs/ext3/namei.c
                }
                if (le32_to_cpu(de->inode)) {
                        brelse (bh);
-@@ -1957,14 +1963,14 @@
+@@ -1965,14 +1972,14 @@ static int ext3_rmdir (struct inode * di
        retval = ext3_delete_entry(handle, dir, de, bh);
        if (retval)
                goto end_rmdir;
@@ -84,7 +84,7 @@ Index: linux/fs/ext3/namei.c
        inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
        ext3_mark_inode_dirty(handle, inode);
        ext3_update_dx_flag(dir);
-@@ -2016,7 +2022,7 @@
+@@ -2024,7 +2031,7 @@ static int ext3_unlink(struct inode * di
        dir->i_ctime = dir->i_mtime = CURRENT_TIME;
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
@@ -93,7 +93,7 @@ Index: linux/fs/ext3/namei.c
        if (!inode->i_nlink)
                ext3_orphan_add(handle, inode);
        inode->i_ctime = dir->i_ctime;
-@@ -2108,9 +2114,8 @@
+@@ -2116,9 +2123,8 @@ static int ext3_link (struct dentry * ol
        if (S_ISDIR(inode->i_mode))
                return -EPERM;
  
@@ -104,7 +104,7 @@ Index: linux/fs/ext3/namei.c
  
        handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
                                        EXT3_INDEX_EXTRA_TRANS_BLOCKS);
-@@ -2194,8 +2199,8 @@
+@@ -2202,8 +2208,8 @@ static int ext3_rename (struct inode * o
                if (le32_to_cpu(PARENT_INO(dir_bh->b_data)) != old_dir->i_ino)
                        goto end_rename;
                retval = -EMLINK;
@@ -115,7 +115,7 @@ Index: linux/fs/ext3/namei.c
                        goto end_rename;
        }
        if (!new_bh) {
-@@ -2253,7 +2258,7 @@
+@@ -2261,7 +2267,7 @@ static int ext3_rename (struct inode * o
        }
  
        if (new_inode) {
@@ -124,7 +124,7 @@ Index: linux/fs/ext3/namei.c
                new_inode->i_ctime = CURRENT_TIME;
        }
        old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
-@@ -2264,11 +2269,13 @@
+@@ -2272,11 +2278,13 @@ static int ext3_rename (struct inode * o
                PARENT_INO(dir_bh->b_data) = le32_to_cpu(new_dir->i_ino);
                BUFFER_TRACE(dir_bh, "call ext3_journal_dirty_metadata");
                ext3_journal_dirty_metadata(handle, dir_bh);
@@ -143,9 +143,9 @@ Index: linux/fs/ext3/namei.c
                }
 Index: linux/include/linux/ext3_fs.h
 ===================================================================
---- linux.orig/include/linux/ext3_fs.h Wed Aug 25 11:34:27 2004
-+++ linux/include/linux/ext3_fs.h      Wed Aug 25 13:14:48 2004
-@@ -79,7 +81,7 @@
+--- linux.orig/include/linux/ext3_fs.h
++++ linux/include/linux/ext3_fs.h
+@@ -79,7 +79,7 @@
  /*
   * Maximal count of links to a file
   */
@@ -154,3 +154,19 @@ Index: linux/include/linux/ext3_fs.h
  
  /*
   * Macro-instructions used to manage several block sizes
+@@ -503,6 +503,7 @@ struct ext3_super_block {
+ #define EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER   0x0001
+ #define EXT3_FEATURE_RO_COMPAT_LARGE_FILE     0x0002
+ #define EXT3_FEATURE_RO_COMPAT_BTREE_DIR      0x0004
++#define EXT3_FEATURE_RO_COMPAT_DIR_NLINK      0x0020
+ #define EXT3_FEATURE_INCOMPAT_COMPRESSION     0x0001
+ #define EXT3_FEATURE_INCOMPAT_FILETYPE                0x0002
+@@ -516,6 +517,7 @@ struct ext3_super_block {
+                                        EXT3_FEATURE_INCOMPAT_EXTENTS)
+ #define EXT3_FEATURE_RO_COMPAT_SUPP   (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
+                                        EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
++                                       EXT3_FEATURE_RO_COMPAT_DIR_NLINK| \
+                                        EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
+ /*
index 4c3ebb8..5956284 100644 (file)
@@ -1,8 +1,8 @@
-Index: 69chaos/fs/ext3/namei.c
+Index: linux-2.4.21/fs/ext3/namei.c
 ===================================================================
---- 69chaos.orig/fs/ext3/namei.c       2004-08-24 23:56:04.000000000 -0700
-+++ 69chaos/fs/ext3/namei.c    2004-08-24 23:57:20.000000000 -0700
-@@ -1542,11 +1542,17 @@
+--- linux-2.4.21.orig/fs/ext3/namei.c
++++ linux-2.4.21/fs/ext3/namei.c
+@@ -1550,11 +1550,17 @@ static int ext3_delete_entry (handle_t *
  static inline void ext3_inc_count(handle_t *handle, struct inode *inode)
  {
        inode->i_nlink++;
@@ -21,7 +21,7 @@ Index: 69chaos/fs/ext3/namei.c
  }
  
  static int ext3_add_nondir(handle_t *handle,
-@@ -1650,7 +1655,7 @@
+@@ -1658,7 +1664,7 @@ static int ext3_mkdir(struct inode * dir
        struct ext3_dir_entry_2 * de;
        int err;
  
@@ -30,7 +30,7 @@ Index: 69chaos/fs/ext3/namei.c
                return -EMLINK;
  
        handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
-@@ -1672,7 +1677,7 @@
+@@ -1680,7 +1686,7 @@ static int ext3_mkdir(struct inode * dir
        inode->i_size = EXT3_I(inode)->i_disksize = inode->i_sb->s_blocksize;
        dir_block = ext3_bread (handle, inode, 0, 1, &err);
        if (!dir_block) {
@@ -39,7 +39,7 @@ Index: 69chaos/fs/ext3/namei.c
                ext3_mark_inode_dirty(handle, inode);
                iput (inode);
                goto out_stop;
-@@ -1704,7 +1709,7 @@
+@@ -1712,7 +1718,7 @@ static int ext3_mkdir(struct inode * dir
                iput (inode);
                goto out_stop;
        }
@@ -48,7 +48,7 @@ Index: 69chaos/fs/ext3/namei.c
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
        d_instantiate(dentry, inode);
-@@ -1765,10 +1770,11 @@
+@@ -1773,10 +1779,11 @@ static int empty_dir (struct inode * ino
                        }
                        de = (struct ext3_dir_entry_2 *) bh->b_data;
                }
@@ -64,7 +64,7 @@ Index: 69chaos/fs/ext3/namei.c
                }
                if (le32_to_cpu(de->inode)) {
                        brelse (bh);
-@@ -1960,14 +1966,14 @@
+@@ -1968,14 +1975,14 @@ static int ext3_rmdir (struct inode * di
        retval = ext3_delete_entry(handle, dir, de, bh);
        if (retval)
                goto end_rmdir;
@@ -84,7 +84,7 @@ Index: 69chaos/fs/ext3/namei.c
        inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
        ext3_mark_inode_dirty(handle, inode);
        ext3_update_dx_flag(dir);
-@@ -2019,7 +2025,7 @@
+@@ -2061,7 +2068,7 @@ static int ext3_unlink(struct inode * di
        dir->i_ctime = dir->i_mtime = CURRENT_TIME;
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
@@ -93,7 +93,7 @@ Index: 69chaos/fs/ext3/namei.c
        if (!inode->i_nlink) {
                ext3_try_to_delay_deletion(inode);
                ext3_orphan_add(handle, inode);
-@@ -2111,9 +2117,8 @@
+@@ -2155,9 +2162,8 @@ static int ext3_link (struct dentry * ol
        if (S_ISDIR(inode->i_mode))
                return -EPERM;
  
@@ -104,7 +104,7 @@ Index: 69chaos/fs/ext3/namei.c
  
        handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
                                        EXT3_INDEX_EXTRA_TRANS_BLOCKS);
-@@ -2197,8 +2202,8 @@
+@@ -2241,8 +2247,8 @@ static int ext3_rename (struct inode * o
                if (le32_to_cpu(PARENT_INO(dir_bh->b_data)) != old_dir->i_ino)
                        goto end_rename;
                retval = -EMLINK;
@@ -115,7 +115,7 @@ Index: 69chaos/fs/ext3/namei.c
                        goto end_rename;
        }
        if (!new_bh) {
-@@ -2256,7 +2261,7 @@
+@@ -2300,7 +2306,7 @@ static int ext3_rename (struct inode * o
        }
  
        if (new_inode) {
@@ -124,7 +124,7 @@ Index: 69chaos/fs/ext3/namei.c
                new_inode->i_ctime = CURRENT_TIME;
        }
        old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
-@@ -2267,11 +2272,13 @@
+@@ -2311,11 +2317,13 @@ static int ext3_rename (struct inode * o
                PARENT_INO(dir_bh->b_data) = le32_to_cpu(new_dir->i_ino);
                BUFFER_TRACE(dir_bh, "call ext3_journal_dirty_metadata");
                ext3_journal_dirty_metadata(handle, dir_bh);
@@ -141,11 +141,11 @@ Index: 69chaos/fs/ext3/namei.c
                        ext3_update_dx_flag(new_dir);
                        ext3_mark_inode_dirty(handle, new_dir);
                }
-Index: 69chaos/include/linux/ext3_fs.h
+Index: linux-2.4.21/include/linux/ext3_fs.h
 ===================================================================
---- 69chaos.orig/include/linux/ext3_fs.h       2004-08-24 23:55:45.000000000 -0700
-+++ 69chaos/include/linux/ext3_fs.h    2004-08-24 23:56:47.000000000 -0700
-@@ -79,7 +81,7 @@
+--- linux-2.4.21.orig/include/linux/ext3_fs.h
++++ linux-2.4.21/include/linux/ext3_fs.h
+@@ -81,7 +81,7 @@
  /*
   * Maximal count of links to a file
   */
@@ -154,3 +154,19 @@ Index: 69chaos/include/linux/ext3_fs.h
  
  /*
   * Macro-instructions used to manage several block sizes
+@@ -505,6 +505,7 @@ static inline struct inode *orphan_list_
+ #define EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER   0x0001
+ #define EXT3_FEATURE_RO_COMPAT_LARGE_FILE     0x0002
+ #define EXT3_FEATURE_RO_COMPAT_BTREE_DIR      0x0004
++#define EXT3_FEATURE_RO_COMPAT_DIR_NLINK       0x0020
+ #define EXT3_FEATURE_INCOMPAT_COMPRESSION     0x0001
+ #define EXT3_FEATURE_INCOMPAT_FILETYPE                0x0002
+@@ -518,6 +519,7 @@ static inline struct inode *orphan_list_
+                                        EXT3_FEATURE_INCOMPAT_EXTENTS)
+ #define EXT3_FEATURE_RO_COMPAT_SUPP   (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
+                                        EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
++                                       EXT3_FEATURE_RO_COMPAT_DIR_NLINK| \
+                                        EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
+ /*
index 621d1b3..0e920f0 100644 (file)
@@ -1,6 +1,8 @@
---- ./fs/ext3/namei.c.orig     2004-08-19 12:53:21.000000000 +0800
-+++ ./fs/ext3/namei.c  2004-08-19 12:44:18.000000000 +0800
-@@ -1541,11 +1541,17 @@
+Index: linux-2.4.24/fs/ext3/namei.c
+===================================================================
+--- linux-2.4.24.orig/fs/ext3/namei.c
++++ linux-2.4.24/fs/ext3/namei.c
+@@ -1549,11 +1549,17 @@ static int ext3_delete_entry (handle_t *
  static inline void ext3_inc_count(handle_t *handle, struct inode *inode)
  {
        inode->i_nlink++;
@@ -19,7 +21,7 @@
  }
  
  static int ext3_add_nondir(handle_t *handle,
-@@ -1646,7 +1651,7 @@
+@@ -1654,7 +1660,7 @@ static int ext3_mkdir(struct inode * dir
        struct ext3_dir_entry_2 * de;
        int err;
  
@@ -28,7 +30,7 @@
                return -EMLINK;
  
        handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
-@@ -1668,7 +1673,7 @@
+@@ -1676,7 +1682,7 @@ static int ext3_mkdir(struct inode * dir
        inode->i_size = EXT3_I(inode)->i_disksize = inode->i_sb->s_blocksize;
        dir_block = ext3_bread (handle, inode, 0, 1, &err);
        if (!dir_block) {
@@ -37,7 +39,7 @@
                ext3_mark_inode_dirty(handle, inode);
                iput (inode);
                goto out_stop;
-@@ -1700,7 +1705,7 @@
+@@ -1708,7 +1714,7 @@ static int ext3_mkdir(struct inode * dir
                iput (inode);
                goto out_stop;
        }
@@ -46,7 +48,7 @@
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
        d_instantiate(dentry, inode);
-@@ -1761,10 +1766,11 @@
+@@ -1769,10 +1775,11 @@ static int empty_dir (struct inode * ino
                        }
                        de = (struct ext3_dir_entry_2 *) bh->b_data;
                }
@@ -62,7 +64,7 @@
                }
                if (le32_to_cpu(de->inode)) {
                        brelse (bh);
-@@ -1957,14 +1963,14 @@
+@@ -1965,14 +1972,14 @@ static int ext3_rmdir (struct inode * di
        retval = ext3_delete_entry(handle, dir, de, bh);
        if (retval)
                goto end_rmdir;
@@ -82,7 +84,7 @@
        inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
        ext3_mark_inode_dirty(handle, inode);
        ext3_update_dx_flag(dir);
-@@ -2046,7 +2052,7 @@
+@@ -2058,7 +2065,7 @@ static int ext3_unlink(struct inode * di
        dir->i_ctime = dir->i_mtime = CURRENT_TIME;
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
@@ -91,7 +93,7 @@
        if (!inode->i_nlink) {
                ext3_try_to_delay_deletion(inode);
                ext3_orphan_add(handle, inode);
-@@ -2140,9 +2146,8 @@
+@@ -2152,9 +2159,8 @@ static int ext3_link (struct dentry * ol
        if (S_ISDIR(inode->i_mode))
                return -EPERM;
  
  
        handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
                                        EXT3_INDEX_EXTRA_TRANS_BLOCKS);
-@@ -2226,8 +2231,8 @@
+@@ -2238,8 +2244,8 @@ static int ext3_rename (struct inode * o
                if (le32_to_cpu(PARENT_INO(dir_bh->b_data)) != old_dir->i_ino)
                        goto end_rename;
                retval = -EMLINK;
                        goto end_rename;
        }
        if (!new_bh) {
-@@ -2285,7 +2290,7 @@
+@@ -2297,7 +2303,7 @@ static int ext3_rename (struct inode * o
        }
  
        if (new_inode) {
                new_inode->i_ctime = CURRENT_TIME;
        }
        old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
-@@ -2296,11 +2301,13 @@
+@@ -2308,11 +2314,13 @@ static int ext3_rename (struct inode * o
                PARENT_INO(dir_bh->b_data) = le32_to_cpu(new_dir->i_ino);
                BUFFER_TRACE(dir_bh, "call ext3_journal_dirty_metadata");
                ext3_journal_dirty_metadata(handle, dir_bh);
                        ext3_update_dx_flag(new_dir);
                        ext3_mark_inode_dirty(handle, new_dir);
                }
---- ./include/linux/ext3_fs.h.orig     2004-08-19 12:53:52.000000000 +0800
-+++ ./include/linux/ext3_fs.h  2004-08-19 11:06:33.000000000 +0800
-@@ -79,7 +81,7 @@
+Index: linux-2.4.24/include/linux/ext3_fs.h
+===================================================================
+--- linux-2.4.24.orig/include/linux/ext3_fs.h
++++ linux-2.4.24/include/linux/ext3_fs.h
+@@ -79,7 +79,7 @@
  /*
   * Maximal count of links to a file
   */
  
  /*
   * Macro-instructions used to manage several block sizes
+@@ -504,6 +504,7 @@ struct ext3_super_block {
+ #define EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER   0x0001
+ #define EXT3_FEATURE_RO_COMPAT_LARGE_FILE     0x0002
+ #define EXT3_FEATURE_RO_COMPAT_BTREE_DIR      0x0004
++#define EXT3_FEATURE_RO_COMPAT_DIR_NLINK      0x0020
+ #define EXT3_FEATURE_INCOMPAT_COMPRESSION     0x0001
+ #define EXT3_FEATURE_INCOMPAT_FILETYPE                0x0002
+@@ -517,6 +518,7 @@ struct ext3_super_block {
+                                        EXT3_FEATURE_INCOMPAT_EXTENTS)
+ #define EXT3_FEATURE_RO_COMPAT_SUPP   (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
+                                        EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
++                                       EXT3_FEATURE_RO_COMPAT_DIR_NLINK| \
+                                        EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
+ /*
index 0d360fa..a818e62 100644 (file)
@@ -1,8 +1,8 @@
-Index: linux-2.6.7/fs/ext3/namei.c
+Index: linux-2.6.5-7.283/fs/ext3/namei.c
 ===================================================================
---- linux-2.6.7.orig/fs/ext3/namei.c   2004-06-15 23:19:36.000000000 -0600
-+++ linux-2.6.7/fs/ext3/namei.c        2004-08-20 17:48:54.000000000 -0600
-@@ -1596,11 +1596,17 @@ static int ext3_delete_entry (handle_t *
+--- linux-2.6.5-7.283.orig/fs/ext3/namei.c
++++ linux-2.6.5-7.283/fs/ext3/namei.c
+@@ -1613,11 +1613,17 @@ static int ext3_delete_entry (handle_t *
  static inline void ext3_inc_count(handle_t *handle, struct inode *inode)
  {
        inode->i_nlink++;
@@ -21,16 +21,16 @@ Index: linux-2.6.7/fs/ext3/namei.c
  }
  
  static int ext3_add_nondir(handle_t *handle,
-@@ -1693,7 +1698,7 @@ static int ext3_mkdir(struct inode * dir
-       struct ext3_dir_entry_2 * de;
+@@ -1730,7 +1736,7 @@ static int ext3_mkdir(struct inode * dir
+       int retries = 0;
        int err;
  
 -      if (dir->i_nlink >= EXT3_LINK_MAX)
 +      if (EXT3_DIR_LINK_MAX(dir))
                return -EMLINK;
  
-       handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
-@@ -1715,7 +1720,7 @@ static int ext3_mkdir(struct inode * dir
+ retry:
+@@ -1752,7 +1758,7 @@ retry:
        inode->i_size = EXT3_I(inode)->i_disksize = inode->i_sb->s_blocksize;
        dir_block = ext3_bread (handle, inode, 0, 1, &err);
        if (!dir_block) {
@@ -39,7 +39,7 @@ Index: linux-2.6.7/fs/ext3/namei.c
                ext3_mark_inode_dirty(handle, inode);
                iput (inode);
                goto out_stop;
-@@ -1747,7 +1752,7 @@ static int ext3_mkdir(struct inode * dir
+@@ -1784,7 +1790,7 @@ retry:
                iput (inode);
                goto out_stop;
        }
@@ -48,7 +48,7 @@ Index: linux-2.6.7/fs/ext3/namei.c
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
        d_instantiate(dentry, inode);
-@@ -2010,10 +2015,10 @@ static int ext3_rmdir (struct inode * di
+@@ -2042,16 +2048,16 @@ static int ext3_rmdir (struct inode * di
        retval = ext3_delete_entry(handle, dir, de, bh);
        if (retval)
                goto end_rmdir;
@@ -62,8 +62,6 @@ Index: linux-2.6.7/fs/ext3/namei.c
 +                           inode->i_nlink);
        inode->i_version++;
        inode->i_nlink = 0;
-       /* There's no need to set i_disksize: the fact that i_nlink is
-@@ -2023,7 +2028,7 @@ static int ext3_rmdir (struct inode * di
        ext3_orphan_add(handle, inode);
        inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
        ext3_mark_inode_dirty(handle, inode);
@@ -72,7 +70,7 @@ Index: linux-2.6.7/fs/ext3/namei.c
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
  
-@@ -2074,7 +2079,7 @@ static int ext3_unlink(struct inode * di
+@@ -2100,7 +2106,7 @@ static int ext3_unlink(struct inode * di
        dir->i_ctime = dir->i_mtime = CURRENT_TIME;
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
@@ -81,16 +79,16 @@ Index: linux-2.6.7/fs/ext3/namei.c
        if (!inode->i_nlink)
                ext3_orphan_add(handle, inode);
        inode->i_ctime = dir->i_ctime;
-@@ -2146,7 +2151,7 @@ static int ext3_link (struct dentry * ol
+@@ -2191,7 +2197,7 @@ static int ext3_link (struct dentry * ol
        struct inode *inode = old_dentry->d_inode;
-       int err;
+       int err, retries = 0;
  
 -      if (inode->i_nlink >= EXT3_LINK_MAX)
 +      if (EXT3_DIR_LINK_MAX(inode))
                return -EMLINK;
  
-       handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
-@@ -2230,8 +2235,8 @@ static int ext3_rename (struct inode * o
+ retry:
+@@ -2277,8 +2283,8 @@ static int ext3_rename (struct inode * o
                if (le32_to_cpu(PARENT_INO(dir_bh->b_data)) != old_dir->i_ino)
                        goto end_rename;
                retval = -EMLINK;
@@ -101,7 +99,7 @@ Index: linux-2.6.7/fs/ext3/namei.c
                        goto end_rename;
        }
        if (!new_bh) {
-@@ -2288,7 +2293,7 @@ static int ext3_rename (struct inode * o
+@@ -2335,7 +2341,7 @@ static int ext3_rename (struct inode * o
        }
  
        if (new_inode) {
@@ -110,7 +108,7 @@ Index: linux-2.6.7/fs/ext3/namei.c
                new_inode->i_ctime = CURRENT_TIME;
        }
        old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME;
-@@ -2299,11 +2304,13 @@ static int ext3_rename (struct inode * o
+@@ -2346,11 +2352,13 @@ static int ext3_rename (struct inode * o
                PARENT_INO(dir_bh->b_data) = le32_to_cpu(new_dir->i_ino);
                BUFFER_TRACE(dir_bh, "call ext3_journal_dirty_metadata");
                ext3_journal_dirty_metadata(handle, dir_bh);
@@ -127,11 +125,11 @@ Index: linux-2.6.7/fs/ext3/namei.c
                        ext3_update_dx_flag(new_dir);
                        ext3_mark_inode_dirty(handle, new_dir);
                }
-Index: linux-2.6.7/include/linux/ext3_fs.h
+Index: linux-2.6.5-7.283/include/linux/ext3_fs.h
 ===================================================================
---- linux-2.6.7.orig/include/linux/ext3_fs.h   2004-06-15 23:19:36.000000000 -0600
-+++ linux-2.6.7/include/linux/ext3_fs.h        2004-08-20 17:41:27.000000000 -0600
-@@ -79,7 +81,7 @@
+--- linux-2.6.5-7.283.orig/include/linux/ext3_fs.h
++++ linux-2.6.5-7.283/include/linux/ext3_fs.h
+@@ -86,7 +86,7 @@ struct statfs;
  /*
   * Maximal count of links to a file
   */
@@ -140,3 +138,19 @@ Index: linux-2.6.7/include/linux/ext3_fs.h
  
  /*
   * Macro-instructions used to manage several block sizes
+@@ -538,6 +538,7 @@ static inline struct ext3_inode_info *EX
+ #define EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER   0x0001
+ #define EXT3_FEATURE_RO_COMPAT_LARGE_FILE     0x0002
+ #define EXT3_FEATURE_RO_COMPAT_BTREE_DIR      0x0004
++#define EXT3_FEATURE_RO_COMPAT_DIR_NLINK      0x0020
+ #define EXT3_FEATURE_INCOMPAT_COMPRESSION     0x0001
+ #define EXT3_FEATURE_INCOMPAT_FILETYPE                0x0002
+@@ -553,6 +554,7 @@ static inline struct ext3_inode_info *EX
+                                        EXT3_FEATURE_INCOMPAT_EXTENTS)
+ #define EXT3_FEATURE_RO_COMPAT_SUPP   (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
+                                        EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
++                                       EXT3_FEATURE_RO_COMPAT_DIR_NLINK| \
+                                        EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
+ /*
index 37cca81..147928c 100644 (file)
@@ -1,7 +1,8 @@
-diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
---- orig/fs/ext3/namei.c       2005-10-12 13:58:19.000000000 -0700
-+++ patch/fs/ext3/namei.c      2005-10-12 14:00:33.000000000 -0700
-@@ -1603,11 +1603,17 @@
+Index: linux-2.6.12/fs/ext3/namei.c
+===================================================================
+--- linux-2.6.12.orig/fs/ext3/namei.c
++++ linux-2.6.12/fs/ext3/namei.c
+@@ -1600,11 +1600,17 @@ static int ext3_delete_entry (handle_t *
  static inline void ext3_inc_count(handle_t *handle, struct inode *inode)
  {
        inode->i_nlink++;
@@ -20,7 +21,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
  }
  
  static int ext3_add_nondir(handle_t *handle,
-@@ -1706,7 +1712,7 @@ static int ext3_add_nondir(handle_t
+@@ -1703,7 +1709,7 @@ static int ext3_mkdir(struct inode * dir
        struct ext3_dir_entry_2 * de;
        int err, retries = 0;
  
@@ -29,7 +30,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
                return -EMLINK;
  
  retry:
-@@ -1729,7 +1735,7 @@ static int ext3_mkdir(struct inode
+@@ -1726,7 +1732,7 @@ retry:
        inode->i_size = EXT3_I(inode)->i_disksize = inode->i_sb->s_blocksize;
        dir_block = ext3_bread (handle, inode, 0, 1, &err);
        if (!dir_block) {
@@ -38,7 +39,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
                ext3_mark_inode_dirty(handle, inode);
                iput (inode);
                goto out_stop;
-@@ -1761,7 +1767,7 @@ static int ext3_mkdir(struct inode
+@@ -1758,7 +1764,7 @@ retry:
                iput (inode);
                goto out_stop;
        }
@@ -47,7 +48,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
        d_instantiate(dentry, inode);
-@@ -2026,10 +2032,10 @@ static int ext3_rmdir (struct inode
+@@ -2023,10 +2029,10 @@ static int ext3_rmdir (struct inode * di
        retval = ext3_delete_entry(handle, dir, de, bh);
        if (retval)
                goto end_rmdir;
@@ -62,7 +63,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
        inode->i_version++;
        inode->i_nlink = 0;
        /* There's no need to set i_disksize: the fact that i_nlink is
-@@ -2039,7 +2045,7 @@ static int ext3_rmdir (struct inode
+@@ -2036,7 +2042,7 @@ static int ext3_rmdir (struct inode * di
        ext3_orphan_add(handle, inode);
        inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC;
        ext3_mark_inode_dirty(handle, inode);
@@ -71,7 +72,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
  
-@@ -2090,7 +2096,7 @@ static int ext3_unlink(struct inode
+@@ -2087,7 +2093,7 @@ static int ext3_unlink(struct inode * di
        dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC;
        ext3_update_dx_flag(dir);
        ext3_mark_inode_dirty(handle, dir);
@@ -80,7 +81,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
        if (!inode->i_nlink)
                ext3_orphan_add(handle, inode);
        inode->i_ctime = dir->i_ctime;
-@@ -2165,7 +2171,7 @@ static int ext3_link (struct dentry
+@@ -2162,7 +2168,7 @@ static int ext3_link (struct dentry * ol
        struct inode *inode = old_dentry->d_inode;
        int err, retries = 0;
  
@@ -89,7 +90,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
                return -EMLINK;
  
  retry:
-@@ -2252,8 +2258,8 @@ static int ext3_rename (struct inode
+@@ -2249,8 +2255,8 @@ static int ext3_rename (struct inode * o
                if (le32_to_cpu(PARENT_INO(dir_bh->b_data)) != old_dir->i_ino)
                        goto end_rename;
                retval = -EMLINK;
@@ -100,7 +101,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
                        goto end_rename;
        }
        if (!new_bh) {
-@@ -2310,7 +2316,7 @@ static int ext3_rename (struct inode
+@@ -2307,7 +2313,7 @@ static int ext3_rename (struct inode * o
        }
  
        if (new_inode) {
@@ -109,7 +110,7 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
                new_inode->i_ctime = CURRENT_TIME_SEC;
        }
        old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME_SEC;
-@@ -2321,11 +2327,13 @@ static int ext3_rename (struct inode
+@@ -2318,11 +2324,13 @@ static int ext3_rename (struct inode * o
                PARENT_INO(dir_bh->b_data) = cpu_to_le32(new_dir->i_ino);
                BUFFER_TRACE(dir_bh, "call ext3_journal_dirty_metadata");
                ext3_journal_dirty_metadata(handle, dir_bh);
@@ -126,12 +127,11 @@ diff -Nur orig/fs/ext3/namei.c patch/fs/ext3/namei.c
                        ext3_update_dx_flag(new_dir);
                        ext3_mark_inode_dirty(handle, new_dir);
                }
-
-Index: linux-2.6.7/include/linux/ext3_fs.h
+Index: linux-2.6.12/include/linux/ext3_fs.h
 ===================================================================
---- linux-2.6.7.orig/include/linux/ext3_fs.h   2004-06-15 23:19:36.000000000 -0600
-+++ linux-2.6.7/include/linux/ext3_fs.h        2004-08-20 17:41:27.000000000 -0600
-@@ -79,7 +81,7 @@
+--- linux-2.6.12.orig/include/linux/ext3_fs.h
++++ linux-2.6.12/include/linux/ext3_fs.h
+@@ -78,7 +78,7 @@ struct statfs;
  /*
   * Maximal count of links to a file
   */
@@ -140,3 +140,19 @@ Index: linux-2.6.7/include/linux/ext3_fs.h
  
  /*
   * Macro-instructions used to manage several block sizes
+@@ -539,6 +539,7 @@ static inline struct ext3_inode_info *EX
+ #define EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER   0x0001
+ #define EXT3_FEATURE_RO_COMPAT_LARGE_FILE     0x0002
+ #define EXT3_FEATURE_RO_COMPAT_BTREE_DIR      0x0004
++#define EXT3_FEATURE_RO_COMPAT_DIR_NLINK              0x0020
+ #define EXT3_FEATURE_INCOMPAT_COMPRESSION     0x0001
+ #define EXT3_FEATURE_INCOMPAT_FILETYPE                0x0002
+@@ -552,6 +553,7 @@ static inline struct ext3_inode_info *EX
+                                        EXT3_FEATURE_INCOMPAT_META_BG)
+ #define EXT3_FEATURE_RO_COMPAT_SUPP   (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
+                                        EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
++                                       EXT3_FEATURE_RO_COMPAT_DIR_NLINK| \
+                                        EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
+ /*