From: adilger Date: Sat, 26 Mar 2005 08:27:13 +0000 (+0000) Subject: Branch: b1_4 X-Git-Tag: v1_8_0_110~486^7~105 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=8f9b94d51c1e518d8628b778822443947a510191;p=fs%2Flustre-release.git Branch: b1_4 Fix regression caught by e2fsck - we weren't unlinking empty directories if they were renamed-over by another directory. This is impossible to do with a shell, as it will move the source dir INTO the target instead of OVER the target. b=5953 --- diff --git a/ldiskfs/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch b/ldiskfs/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch index b9bcfac..4de2b32 100644 --- a/ldiskfs/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch +++ b/ldiskfs/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch @@ -2192,11 +2192,11 @@ Index: linux-2.6.5-suse/include/linux/ext3_fs_sb.h + __u32 bb_bitmap; + __u32 bb_buddy; + spinlock_t bb_lock; -+ unsigned long bb_tid; ++ unsigned long bb_tid; + struct ext3_free_metadata *bb_md_cur; + unsigned short bb_first_free; + unsigned short bb_free; -+ unsigned bb_counters[]; ++ unsigned bb_counters[]; +}; + /* diff --git a/ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.7.patch b/ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.7.patch index d5b771a..bb9fc1b 100644 --- a/ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.7.patch +++ b/ldiskfs/kernel_patches/patches/ext3-nlinks-2.6.7.patch @@ -110,7 +110,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,11 @@ static int ext3_rename (struct inode * o +@@ -2299,11 +2304,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); @@ -118,7 +118,9 @@ Index: linux-2.6.7/fs/ext3/namei.c + ext3_dec_count(handle, old_dir); if (new_inode) { - new_inode->i_nlink--; -+ ext3_dec_count(handle, new_inode); ++ /* checked empty_dir above, can't have another parent, ++ * ext3_dec_count() won't work for many-linked dirs */ ++ new_inode->i_nlink = 0; } else { - new_dir->i_nlink++; + ext3_inc_count(handle, new_dir); diff --git a/lustre/kernel_patches/patches/ext3-mballoc2-2.4.24.patch b/lustre/kernel_patches/patches/ext3-mballoc2-2.4.24.patch index 3782889..172432a 100644 --- a/lustre/kernel_patches/patches/ext3-mballoc2-2.4.24.patch +++ b/lustre/kernel_patches/patches/ext3-mballoc2-2.4.24.patch @@ -1738,7 +1738,7 @@ Index: linux-2.4.20-rh-20.9/include/linux/ext3_fs_sb.h + unsigned long bb_bitmap; + unsigned long bb_buddy; + spinlock_t bb_lock; -+ unsigned bb_counters[EXT3_BB_MAX_ORDER]; ++ unsigned bb_counters[EXT3_BB_MAX_ORDER]; + struct ext3_free_metadata *bb_md_cur; + unsigned long bb_tid; +}; diff --git a/lustre/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch b/lustre/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch index b9bcfac..4de2b32 100644 --- a/lustre/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch +++ b/lustre/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch @@ -2192,11 +2192,11 @@ Index: linux-2.6.5-suse/include/linux/ext3_fs_sb.h + __u32 bb_bitmap; + __u32 bb_buddy; + spinlock_t bb_lock; -+ unsigned long bb_tid; ++ unsigned long bb_tid; + struct ext3_free_metadata *bb_md_cur; + unsigned short bb_first_free; + unsigned short bb_free; -+ unsigned bb_counters[]; ++ unsigned bb_counters[]; +}; + /* diff --git a/lustre/kernel_patches/patches/ext3-nlinks-2.4.20-hp_pnnl.patch b/lustre/kernel_patches/patches/ext3-nlinks-2.4.20-hp_pnnl.patch index d2b3cd2..40bbaa5 100644 --- a/lustre/kernel_patches/patches/ext3-nlinks-2.4.20-hp_pnnl.patch +++ b/lustre/kernel_patches/patches/ext3-nlinks-2.4.20-hp_pnnl.patch @@ -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,11 @@ +@@ -2264,11 +2269,13 @@ 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); @@ -132,7 +132,9 @@ Index: linux/fs/ext3/namei.c + ext3_dec_count(handle, old_dir); if (new_inode) { - new_inode->i_nlink--; -+ ext3_dec_count(handle, new_inode); ++ /* checked empty_dir above, can't have another parent, ++ * ext3_dec_count() won't work for many-linked dirs */ ++ new_inode->i_nlink = 0; } else { - new_dir->i_nlink++; + ext3_inc_count(handle, new_dir); diff --git a/lustre/kernel_patches/patches/ext3-nlinks-2.4.21-chaos.patch b/lustre/kernel_patches/patches/ext3-nlinks-2.4.21-chaos.patch index 5990323..4543943 100644 --- a/lustre/kernel_patches/patches/ext3-nlinks-2.4.21-chaos.patch +++ b/lustre/kernel_patches/patches/ext3-nlinks-2.4.21-chaos.patch @@ -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,11 @@ +@@ -2267,11 +2272,13 @@ 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); @@ -132,7 +132,9 @@ Index: 69chaos/fs/ext3/namei.c + ext3_dec_count(handle, old_dir); if (new_inode) { - new_inode->i_nlink--; -+ ext3_dec_count(handle, new_inode); ++ /* checked empty_dir above, can't have another parent, ++ * ext3_dec_count() won't work for many-linked dirs */ ++ new_inode->i_nlink = 0; } else { - new_dir->i_nlink++; + ext3_inc_count(handle, new_dir); diff --git a/lustre/kernel_patches/patches/ext3-nlinks-2.4.24.patch b/lustre/kernel_patches/patches/ext3-nlinks-2.4.24.patch index b230d34..245d83e 100644 --- a/lustre/kernel_patches/patches/ext3-nlinks-2.4.24.patch +++ b/lustre/kernel_patches/patches/ext3-nlinks-2.4.24.patch @@ -122,7 +122,7 @@ new_inode->i_ctime = CURRENT_TIME; } old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME; -@@ -2296,11 +2301,11 @@ +@@ -2296,11 +2301,13 @@ 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); @@ -130,7 +130,9 @@ + ext3_dec_count(handle, old_dir); if (new_inode) { - new_inode->i_nlink--; -+ ext3_dec_count(handle, new_inode); ++ /* checked empty_dir above, can't have another parent, ++ * ext3_dec_count() won't work for many-linked dirs */ ++ new_inode->i_nlink = 0; } else { - new_dir->i_nlink++; + ext3_inc_count(handle, new_dir); diff --git a/lustre/kernel_patches/patches/ext3-nlinks-2.6.7.patch b/lustre/kernel_patches/patches/ext3-nlinks-2.6.7.patch index d5b771a..bb9fc1b 100644 --- a/lustre/kernel_patches/patches/ext3-nlinks-2.6.7.patch +++ b/lustre/kernel_patches/patches/ext3-nlinks-2.6.7.patch @@ -110,7 +110,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,11 @@ static int ext3_rename (struct inode * o +@@ -2299,11 +2304,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); @@ -118,7 +118,9 @@ Index: linux-2.6.7/fs/ext3/namei.c + ext3_dec_count(handle, old_dir); if (new_inode) { - new_inode->i_nlink--; -+ ext3_dec_count(handle, new_inode); ++ /* checked empty_dir above, can't have another parent, ++ * ext3_dec_count() won't work for many-linked dirs */ ++ new_inode->i_nlink = 0; } else { - new_dir->i_nlink++; + ext3_inc_count(handle, new_dir);