1 Index: linux-2.4.19.SuSE/fs/ext3/namei.c
2 ===================================================================
3 --- linux-2.4.19.SuSE.orig/fs/ext3/namei.c Sun Nov 16 01:14:50 2003
4 +++ linux-2.4.19.SuSE/fs/ext3/namei.c Sun Nov 16 01:18:04 2003
6 struct super_block *sb = inode->i_sb;
12 + down(&EXT3_SB(sb)->s_orphan_lock);
13 if (!list_empty(&EXT3_I(inode)->i_orphan))
17 jbd_debug(4, "orphan inode %ld will point to %d\n",
18 inode->i_ino, NEXT_ORPHAN(inode));
21 + up(&EXT3_SB(sb)->s_orphan_lock);
22 ext3_std_error(inode->i_sb, err);
25 @@ -1813,20 +1813,19 @@
27 struct list_head *prev;
28 struct ext3_inode_info *ei = EXT3_I(inode);
29 - struct ext3_sb_info *sbi;
30 + struct ext3_sb_info *sbi = EXT3_SB(inode->i_sb);
31 unsigned long ino_next;
32 struct ext3_iloc iloc;
35 - lock_super(inode->i_sb);
36 + down(&sbi->s_orphan_lock);
37 if (list_empty(&ei->i_orphan)) {
38 - unlock_super(inode->i_sb);
39 + up(&sbi->s_orphan_lock);
43 ino_next = NEXT_ORPHAN(inode);
44 prev = ei->i_orphan.prev;
45 - sbi = EXT3_SB(inode->i_sb);
47 jbd_debug(4, "remove inode %lu from orphan list\n", inode->i_ino);
49 @@ -1872,10 +1871,10 @@
55 ext3_std_error(inode->i_sb, err);
57 - unlock_super(inode->i_sb);
58 + up(&sbi->s_orphan_lock);
62 Index: linux-2.4.19.SuSE/fs/ext3/super.c
63 ===================================================================
64 --- linux-2.4.19.SuSE.orig/fs/ext3/super.c Sun Nov 16 00:40:59 2003
65 +++ linux-2.4.19.SuSE/fs/ext3/super.c Sun Nov 16 01:18:04 2003
68 sb->s_op = &ext3_sops;
69 INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */
70 + sema_init(&sbi->s_orphan_lock, 1);
74 Index: linux-2.4.19.SuSE/include/linux/ext3_fs_sb.h
75 ===================================================================
76 --- linux-2.4.19.SuSE.orig/include/linux/ext3_fs_sb.h Sat Nov 15 23:58:28 2003
77 +++ linux-2.4.19.SuSE/include/linux/ext3_fs_sb.h Sun Nov 16 01:18:41 2003
79 struct inode * s_journal_inode;
80 struct journal_s * s_journal;
81 struct list_head s_orphan;
82 + struct semaphore s_orphan_lock;
83 struct block_device *journal_bdev;
84 #ifdef CONFIG_JBD_DEBUG
85 struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */