From e0ed72f71b93c210185b8230a7397153f82890fa Mon Sep 17 00:00:00 2001 From: deshmukh Date: Fri, 5 Dec 2008 04:12:08 +0000 Subject: [PATCH] Fixing the vanilla 2.6.22 build b=17760 i=adilger i=anserper --- .../kernel_patches/patches/ext3-nlinks-2.6.9.patch | 66 ++++++++++++++-------- .../patches/ext3-osd-iop-common.patch | 4 +- 2 files changed, 43 insertions(+), 27 deletions(-) diff --git a/ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.9.patch b/ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.9.patch index fb32a64..310b645 100644 --- a/ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.9.patch +++ b/ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.9.patch @@ -1,8 +1,8 @@ -Index: linux-2.6.12/fs/ext3/namei.c +Index: linux-2.6.18-53.1.14/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 * +--- linux-2.6.18-53.1.14/fs/ext3/namei.c 2008-12-02 13:21:14.000000000 +0530 ++++ linux-2.6.18-53.1.14_new/fs/ext3/namei.c 2008-12-02 15:11:09.000000000 +0530 +@@ -1656,13 +1656,24 @@ static int ext3_delete_entry (handle_t * static inline void ext3_inc_count(handle_t *handle, struct inode *inode) { inode->i_nlink++; @@ -13,15 +13,22 @@ Index: linux-2.6.12/fs/ext3/namei.c + } } - static inline void ext3_dec_count(handle_t *handle, struct inode *inode) +-static inline void ext3_dec_count(handle_t *handle, struct inode *inode) ++static inline void drop_nlink(struct inode *inode) { -- inode->i_nlink--; -+ if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2) -+ inode->i_nlink--; + inode->i_nlink--; } ++static inline void ext3_dec_count(handle_t *handle, struct inode *inode) ++{ ++ if (!S_ISDIR(inode->i_mode) || inode->i_nlink > 2) ++ drop_nlink(inode); ++} ++ static int ext3_add_nondir(handle_t *handle, -@@ -1703,7 +1709,7 @@ static int ext3_mkdir(struct inode * dir + struct dentry *dentry, struct inode *inode) + { +@@ -1759,7 +1770,7 @@ static int ext3_mkdir(struct inode * dir struct ext3_dir_entry_2 * de; int err, retries = 0; @@ -30,7 +37,16 @@ Index: linux-2.6.12/fs/ext3/namei.c return -EMLINK; retry: -@@ -1758,7 +1764,7 @@ retry: +@@ -1782,7 +1793,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) { +- inode->i_nlink--; /* is this nlink == 0? */ ++ drop_nlink(inode); /* is this nlink == 0? */ + ext3_mark_inode_dirty(handle, inode); + iput (inode); + goto out_stop; +@@ -1814,7 +1825,7 @@ retry: iput (inode); goto out_stop; } @@ -39,7 +55,7 @@ Index: linux-2.6.12/fs/ext3/namei.c ext3_update_dx_flag(dir); ext3_mark_inode_dirty(handle, dir); d_instantiate(dentry, inode); -@@ -2023,10 +2029,10 @@ static int ext3_rmdir (struct inode * di +@@ -2079,10 +2090,10 @@ static int ext3_rmdir (struct inode * di retval = ext3_delete_entry(handle, dir, de, bh); if (retval) goto end_rmdir; @@ -54,7 +70,7 @@ Index: linux-2.6.12/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 -@@ -2036,7 +2042,7 @@ static int ext3_rmdir (struct inode * di +@@ -2092,7 +2103,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); @@ -63,7 +79,7 @@ Index: linux-2.6.12/fs/ext3/namei.c ext3_update_dx_flag(dir); ext3_mark_inode_dirty(handle, dir); -@@ -2087,7 +2093,7 @@ static int ext3_unlink(struct inode * di +@@ -2143,7 +2154,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); @@ -72,16 +88,16 @@ Index: linux-2.6.12/fs/ext3/namei.c if (!inode->i_nlink) ext3_orphan_add(handle, inode); inode->i_ctime = dir->i_ctime; -@@ -2162,7 +2168,7 @@ static int ext3_link (struct dentry * ol +@@ -2219,7 +2230,7 @@ static int ext3_link (struct dentry * ol struct inode *inode = old_dentry->d_inode; int err, retries = 0; - if (inode->i_nlink >= EXT3_LINK_MAX) + if (EXT3_DIR_LINK_MAX(inode)) return -EMLINK; - - retry: -@@ -2249,8 +2255,8 @@ static int ext3_rename (struct inode * o + /* + * Return -ENOENT if we've raced with unlink and i_nlink is 0. Doing +@@ -2313,8 +2324,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; @@ -92,7 +108,7 @@ Index: linux-2.6.12/fs/ext3/namei.c goto end_rename; } if (!new_bh) { -@@ -2307,7 +2313,7 @@ static int ext3_rename (struct inode * o +@@ -2371,7 +2382,7 @@ static int ext3_rename (struct inode * o } if (new_inode) { @@ -101,7 +117,7 @@ Index: linux-2.6.12/fs/ext3/namei.c new_inode->i_ctime = CURRENT_TIME_SEC; } old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME_SEC; -@@ -2318,11 +2324,13 @@ static int ext3_rename (struct inode * o +@@ -2382,11 +2393,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); @@ -118,11 +134,11 @@ Index: linux-2.6.12/fs/ext3/namei.c ext3_update_dx_flag(new_dir); ext3_mark_inode_dirty(handle, new_dir); } -Index: linux-2.6.12/include/linux/ext3_fs.h +Index: linux-2.6.18-53.1.14/include/linux/ext3_fs.h =================================================================== ---- 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; +--- linux-2.6.18-53.1.14/include/linux/ext3_fs.h 2008-12-02 13:21:23.000000000 +0530 ++++ linux-2.6.18-53.1.14_new/include/linux/ext3_fs.h 2008-12-02 13:22:04.000000000 +0530 +@@ -74,7 +74,7 @@ /* * Maximal count of links to a file */ @@ -131,7 +147,7 @@ Index: linux-2.6.12/include/linux/ext3_fs.h /* * Macro-instructions used to manage several block sizes -@@ -539,6 +539,7 @@ static inline struct ext3_inode_info *EX +@@ -563,6 +563,7 @@ static inline int ext3_valid_inum(struct #define EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 #define EXT3_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 #define EXT3_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 @@ -139,7 +155,7 @@ Index: linux-2.6.12/include/linux/ext3_fs.h #define EXT3_FEATURE_INCOMPAT_COMPRESSION 0x0001 #define EXT3_FEATURE_INCOMPAT_FILETYPE 0x0002 -@@ -552,6 +553,7 @@ static inline struct ext3_inode_info *EX +@@ -576,6 +577,7 @@ static inline int ext3_valid_inum(struct EXT3_FEATURE_INCOMPAT_META_BG) #define EXT3_FEATURE_RO_COMPAT_SUPP (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \ EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \ diff --git a/ldiskfs/kernel_patches/patches/ext3-osd-iop-common.patch b/ldiskfs/kernel_patches/patches/ext3-osd-iop-common.patch index a25a0e7..76036b3 100644 --- a/ldiskfs/kernel_patches/patches/ext3-osd-iop-common.patch +++ b/ldiskfs/kernel_patches/patches/ext3-osd-iop-common.patch @@ -89,7 +89,7 @@ Index: linux-2.6.18-53.1.14/fs/ext3/namei.c + 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) { -+ inode->i_nlink--; /* is this nlink == 0? */ ++ drop_nlink(inode); /* is this nlink == 0? */ + ext3_mark_inode_dirty(handle, inode); + iput (inode); + goto get_out; @@ -139,7 +139,7 @@ Index: linux-2.6.18-53.1.14/fs/ext3/namei.c - 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) { -- inode->i_nlink--; /* is this nlink == 0? */ +- drop_nlink(inode); /* is this nlink == 0? */ - ext3_mark_inode_dirty(handle, inode); - iput (inode); + err = ext3_add_dot_dotdot(handle, dir, inode); -- 1.8.3.1