X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fkernel_patches%2Fpatches%2Fext3-ea-in-inode-2.4.22-rh.patch;h=6b22a715a59b1eb1c450e63196f87094ec676c12;hb=06eadbd21a895c3ae61844094a2fc89abdda40fc;hp=5800fe0ebc4babe42937c4a0c12e4172590d66ba;hpb=c5050e412572b00cbe93d8517d2d1f767bebfa92;p=fs%2Flustre-release.git diff --git a/lustre/kernel_patches/patches/ext3-ea-in-inode-2.4.22-rh.patch b/lustre/kernel_patches/patches/ext3-ea-in-inode-2.4.22-rh.patch index 5800fe0..6b22a71 100644 --- a/lustre/kernel_patches/patches/ext3-ea-in-inode-2.4.22-rh.patch +++ b/lustre/kernel_patches/patches/ext3-ea-in-inode-2.4.22-rh.patch @@ -8,19 +8,17 @@ --- linux-2.4.22-ac1/fs/ext3/ialloc.c~ext3-ea-in-inode-2.4.22-rh 2003-10-08 13:57:56.000000000 +0400 +++ linux-2.4.22-ac1-alexey/fs/ext3/ialloc.c 2003-10-08 15:13:31.000000000 +0400 -@@ -715,6 +715,12 @@ have_bit_and_group: - insert_inode_hash(inode); +@@ -715,6 +715,10 @@ have_bit_and_group: inode->i_generation = sb->u.ext3_sb.s_next_generation++; -+ if (EXT3_INODE_SIZE(inode->i_sb) > EXT3_GOOD_OLD_INODE_SIZE) { -+ inode->u.ext3_i.i_extra_isize = sizeof(__u16) /* i_extra_isize */ -+ + sizeof(__u16); /* i_pad1 */ -+ } else -+ inode->u.ext3_i.i_extra_isize = 0; -+ inode->u.ext3_i.i_state = EXT3_STATE_NEW; - err = ext3_get_inode_loc_new(inode, &iloc, 1); - if (err) goto fail; ++ inode->u.ext3_i.i_extra_isize = ++ (EXT3_INODE_SIZE(inode->i_sb) > EXT3_GOOD_OLD_INODE_SIZE) ? ++ sizeof(struct ext3_inode) - EXT3_GOOD_OLD_INODE_SIZE : 0; ++ + err = ext3_get_inode_loc_new(inode, &iloc, 1); + if (err) goto fail; + BUFFER_TRACE(iloc->bh, "get_write_access"); --- linux-2.4.22-ac1/fs/ext3/inode.c~ext3-ea-in-inode-2.4.22-rh 2003-10-08 13:57:57.000000000 +0400 +++ linux-2.4.22-ac1-alexey/fs/ext3/inode.c 2003-10-08 15:14:57.000000000 +0400 @@ -2229,6 +2229,12 @@ void ext3_read_inode(struct inode * inod @@ -41,7 +39,7 @@ goto out_brelse; } + if (EXT3_I(inode)->i_state & EXT3_STATE_NEW) -+ memset(raw_inode, 0, EXT3_INODE_SIZE(inode->i_sb)); ++ memset(raw_inode, 0, EXT3_INODE_SIZE(inode->i_sb)); raw_inode->i_mode = cpu_to_le16(inode->i_mode); if(!(test_opt(inode->i_sb, NO_UID32))) { raw_inode->i_uid_low = cpu_to_le16(low_16_bits(inode->i_uid)); @@ -108,7 +106,7 @@ } /* -+ * ext3_xattr_ibode_get() ++ * ext3_xattr_ibody_get() + * + * routine looks for attribute in inode body and returns it's value and size + */ @@ -188,7 +186,7 @@ + /* try to find attribute in inode body */ + err = ext3_xattr_ibody_get(inode, name_index, name, + buffer, buffer_size); -+ if (err < 0) ++ if (err < 0) + /* search was unsuccessful, try to find EA in dedicated block */ + err = ext3_xattr_block_get(inode, name_index, name, + buffer, buffer_size); @@ -231,7 +229,7 @@ + return 0; + + ret = ext3_get_inode_loc(inode, &iloc); -+ if (ret) ++ if (ret) + return ret; + raw_inode = iloc.raw_inode; + @@ -311,7 +309,7 @@ + /* get list of attributes stored in inode body */ + error = ext3_xattr_ibody_list(inode, buffer, buffer_size); + if (error < 0) { -+ /* some error occured while collecting ++ /* some error occured while collecting + * attributes in inode body */ + size = 0; + goto cleanup; @@ -324,12 +322,12 @@ + if (buffer_size <= 0) { + buffer = NULL; + buffer_size = 0; -+ } else ++ } else + buffer += error; + } + + error = ext3_xattr_block_list(inode, buffer, buffer_size); -+ if (error < 0) ++ if (error < 0) + /* listing was successful, so we return len */ + size = 0; + @@ -350,7 +348,7 @@ + * NOTE: free space includes space our attribute hold + */ +int -+ext3_xattr_ibody_find(struct inode *inode, int name_index, ++ext3_xattr_ibody_find(struct inode *inode, int name_index, + const char *name, struct ext3_xattr_entry *rentry, int *free) +{ + struct ext3_xattr_entry *last; @@ -365,7 +363,7 @@ + return ret; + + err = ext3_get_inode_loc(inode, &iloc); -+ if (err) ++ if (err) + return -EIO; + raw_inode = iloc.raw_inode; + @@ -474,7 +472,7 @@ + +/* + * ext3_xattr_inode_set() -+ * ++ * + * this routine add/remove/replace attribute in inode body + */ +int @@ -534,7 +532,7 @@ + } + if (name_index == last->e_name_index && + name_len == last->e_name_len && -+ !memcmp(name, last->e_name, name_len)) ++ !memcmp(name, last->e_name, name_len)) + here = last; + else { + /* we calculate all but our attribute @@ -571,9 +569,9 @@ + e = (struct ext3_xattr_entry *) start; + while (!IS_LAST_ENTRY(e)) { + struct ext3_xattr_entry *next = EXT3_XATTR_NEXT(e); -+ int offs = le16_to_cpu(e->e_value_offs); -+ if (offs < border) -+ e->e_value_offs = ++ int offs = le16_to_cpu(e->e_value_offs); ++ if (offs < border) ++ e->e_value_offs = + cpu_to_le16(offs + size); + e = next; + } @@ -620,7 +618,7 @@ * ext3_xattr_set() * * Create, replace or remove an extended attribute for this inode. Buffer -@@ -566,6 +1050,100 @@ static void ext3_xattr_update_super_bloc +@@ -566,6 +1050,101 @@ static void ext3_xattr_update_super_bloc */ int ext3_xattr_set(handle_t *handle, struct inode *inode, int name_index, @@ -660,10 +658,11 @@ + if (err != 0 && err != -ENOENT) { + /* not found EA in block */ + goto finish; ++ } else if (err == 0) { ++ /* found EA in block */ ++ where = 1; ++ found = 1; + } -+ /* found EA in block */ -+ where = 1; -+ found = 1; + } else + goto finish; + @@ -713,7 +712,7 @@ + +/* + * ext3_xattr_block_set() -+ * ++ * + * this routine add/remove/replace attribute in EA block + */ +int @@ -746,7 +745,7 @@ */ loff_t i_disksize; -+ /* on-disk additional lenght */ ++ /* on-disk additional length */ + __u16 i_extra_isize; + /*