From 664195824f529108ea2c3537b4c0288939959670 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 11 Jan 2004 22:14:56 +0000 Subject: [PATCH] - truncate case sets i_nlink to 1 - additional assert NOTE: it passes sanity and single-replay --- .../patches/ext3-delete_thread-2.4.24.patch | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lustre/kernel_patches/patches/ext3-delete_thread-2.4.24.patch b/lustre/kernel_patches/patches/ext3-delete_thread-2.4.24.patch index b274755..ab8c168 100644 --- a/lustre/kernel_patches/patches/ext3-delete_thread-2.4.24.patch +++ b/lustre/kernel_patches/patches/ext3-delete_thread-2.4.24.patch @@ -8,8 +8,8 @@ Index: linux-2.4.24-vanilla/fs/ext3/super.c =================================================================== --- linux-2.4.24-vanilla.orig/fs/ext3/super.c 2004-01-10 17:49:10.000000000 +0300 -+++ linux-2.4.24-vanilla/fs/ext3/super.c 2004-01-11 22:30:24.000000000 +0300 -@@ -400,6 +400,126 @@ ++++ linux-2.4.24-vanilla/fs/ext3/super.c 2004-01-11 23:13:34.000000000 +0300 +@@ -400,6 +400,127 @@ } } @@ -77,6 +77,7 @@ Index: linux-2.4.24-vanilla/fs/ext3/super.c + ext3_debug("%s delete ino %lu blk %lu\n", + tsk->comm, inode->i_ino, blocks); + ++ J_ASSERT(EXT3_I(inode)->i_state & EXT3_STATE_DELETE); + J_ASSERT(inode->i_nlink == 1); + inode->i_nlink = 0; + iput(inode); @@ -136,7 +137,7 @@ Index: linux-2.4.24-vanilla/fs/ext3/super.c void ext3_put_super (struct super_block * sb) { struct ext3_sb_info *sbi = EXT3_SB(sb); -@@ -527,6 +647,13 @@ +@@ -527,6 +648,13 @@ clear_opt (*mount_options, XATTR_USER); else #endif @@ -150,7 +151,7 @@ Index: linux-2.4.24-vanilla/fs/ext3/super.c if (!strcmp (this_char, "bsddf")) clear_opt (*mount_options, MINIX_DF); else if (!strcmp (this_char, "nouid32")) { -@@ -1227,6 +1354,7 @@ +@@ -1227,6 +1355,7 @@ } ext3_setup_super (sb, es, sb->s_flags & MS_RDONLY); @@ -158,7 +159,7 @@ Index: linux-2.4.24-vanilla/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 -@@ -1618,7 +1746,12 @@ +@@ -1618,7 +1747,12 @@ static int ext3_sync_fs(struct super_block *sb) { tid_t target; @@ -172,7 +173,7 @@ Index: linux-2.4.24-vanilla/fs/ext3/super.c sb->s_dirt = 0; target = log_start_commit(EXT3_SB(sb)->s_journal, NULL); log_wait_commit(EXT3_SB(sb)->s_journal, target); -@@ -1682,6 +1815,9 @@ +@@ -1682,6 +1816,9 @@ if (!parse_options(data, &tmp, sbi, &tmp, 1)) return -EINVAL; @@ -185,7 +186,7 @@ Index: linux-2.4.24-vanilla/fs/ext3/super.c Index: linux-2.4.24-vanilla/fs/ext3/inode.c =================================================================== --- linux-2.4.24-vanilla.orig/fs/ext3/inode.c 2004-01-10 17:49:11.000000000 +0300 -+++ linux-2.4.24-vanilla/fs/ext3/inode.c 2004-01-11 22:26:24.000000000 +0300 ++++ linux-2.4.24-vanilla/fs/ext3/inode.c 2004-01-11 23:12:44.000000000 +0300 @@ -2551,6 +2551,118 @@ return err; } @@ -258,7 +259,7 @@ Index: linux-2.4.24-vanilla/fs/ext3/inode.c + new_inode->i_blocks = old_inode->i_blocks; + new_inode->i_uid = old_inode->i_uid; + new_inode->i_gid = old_inode->i_gid; -+ new_inode->i_nlink = 0; ++ new_inode->i_nlink = 1; + + /* FIXME when we do arbitrary truncates */ + old_inode->i_blocks = oei->i_file_acl ? old_inode->i_blksize / 512 : 0; @@ -308,7 +309,7 @@ Index: linux-2.4.24-vanilla/fs/ext3/inode.c Index: linux-2.4.24-vanilla/fs/ext3/file.c =================================================================== --- linux-2.4.24-vanilla.orig/fs/ext3/file.c 2004-01-10 17:49:10.000000000 +0300 -+++ linux-2.4.24-vanilla/fs/ext3/file.c 2004-01-11 22:26:24.000000000 +0300 ++++ linux-2.4.24-vanilla/fs/ext3/file.c 2004-01-11 23:08:54.000000000 +0300 @@ -126,7 +126,11 @@ }; @@ -324,7 +325,7 @@ Index: linux-2.4.24-vanilla/fs/ext3/file.c Index: linux-2.4.24-vanilla/fs/ext3/namei.c =================================================================== --- linux-2.4.24-vanilla.orig/fs/ext3/namei.c 2004-01-10 17:49:10.000000000 +0300 -+++ linux-2.4.24-vanilla/fs/ext3/namei.c 2004-01-11 22:26:24.000000000 +0300 ++++ linux-2.4.24-vanilla/fs/ext3/namei.c 2004-01-11 23:08:54.000000000 +0300 @@ -1936,6 +1936,36 @@ return retval; } @@ -377,7 +378,7 @@ Index: linux-2.4.24-vanilla/fs/ext3/namei.c Index: linux-2.4.24-vanilla/include/linux/ext3_fs.h =================================================================== --- linux-2.4.24-vanilla.orig/include/linux/ext3_fs.h 2004-01-10 17:49:11.000000000 +0300 -+++ linux-2.4.24-vanilla/include/linux/ext3_fs.h 2004-01-11 22:26:24.000000000 +0300 ++++ linux-2.4.24-vanilla/include/linux/ext3_fs.h 2004-01-11 23:08:54.000000000 +0300 @@ -193,6 +193,7 @@ */ #define EXT3_STATE_JDATA 0x00000001 /* journaled data exists */ @@ -407,7 +408,7 @@ Index: linux-2.4.24-vanilla/include/linux/ext3_fs.h Index: linux-2.4.24-vanilla/include/linux/ext3_fs_sb.h =================================================================== --- linux-2.4.24-vanilla.orig/include/linux/ext3_fs_sb.h 2004-01-10 17:49:10.000000000 +0300 -+++ linux-2.4.24-vanilla/include/linux/ext3_fs_sb.h 2004-01-11 22:28:44.000000000 +0300 ++++ linux-2.4.24-vanilla/include/linux/ext3_fs_sb.h 2004-01-11 23:08:54.000000000 +0300 @@ -29,6 +29,8 @@ #define EXT3_MAX_GROUP_LOADED 8 -- 1.8.3.1