1 diff -ru lum-2.4.18-um30/fs/ext3/balloc.c uml-2.4.18-12.5/fs/ext3/balloc.c
2 --- lum-2.4.18-um30/fs/ext3/balloc.c Mon Feb 25 12:38:08 2002
3 +++ uml-2.4.18-12.5/fs/ext3/balloc.c Thu Sep 19 13:40:11 2002
7 es = sb->u.ext3_sb.s_es;
8 - if (block < le32_to_cpu(es->s_first_data_block) ||
9 + if (block < le32_to_cpu(es->s_first_data_block) ||
10 + block + count < block ||
11 (block + count) > le32_to_cpu(es->s_blocks_count)) {
12 ext3_error (sb, "ext3_free_blocks",
13 "Freeing blocks not in datazone - "
18 - if (in_range (le32_to_cpu(gdp->bg_block_bitmap), block, count) ||
19 - in_range (le32_to_cpu(gdp->bg_inode_bitmap), block, count) ||
20 - in_range (block, le32_to_cpu(gdp->bg_inode_table),
21 - sb->u.ext3_sb.s_itb_per_group) ||
22 - in_range (block + count - 1, le32_to_cpu(gdp->bg_inode_table),
23 - sb->u.ext3_sb.s_itb_per_group))
24 - ext3_error (sb, "ext3_free_blocks",
25 - "Freeing blocks in system zones - "
26 - "Block = %lu, count = %lu",
30 * We are about to start releasing blocks in the bitmap,
31 * so we need undo access.
36 - for (i = 0; i < count; i++) {
37 + for (i = 0; i < count; i++, block++) {
38 + if (block == le32_to_cpu(gdp->bg_block_bitmap) ||
39 + block == le32_to_cpu(gdp->bg_inode_bitmap) ||
40 + in_range(block, le32_to_cpu(gdp->bg_inode_table),
41 + sb->u.ext2_sb.s_itb_per_group)) {
42 + ext3_error(sb, __FUNCTION__,
43 + "Freeing block in system zone - block = %lu",
49 * An HJ special. This is expensive...
51 #ifdef CONFIG_JBD_DEBUG
53 struct buffer_head *debug_bh;
54 - debug_bh = sb_get_hash_table(sb, block + i);
55 + debug_bh = sb_get_hash_table(sb, block);
57 BUFFER_TRACE(debug_bh, "Deleted!");
58 if (!bh2jh(bitmap_bh)->b_committed_data)
61 BUFFER_TRACE(bitmap_bh, "clear bit");
62 if (!ext3_clear_bit (bit + i, bitmap_bh->b_data)) {
63 - ext3_error (sb, __FUNCTION__,
64 - "bit already cleared for block %lu",
66 + ext3_error(sb, __FUNCTION__,
67 + "bit already cleared for block %lu", block);
68 BUFFER_TRACE(bitmap_bh, "bit already cleared");
74 if (overflow && !err) {
81 ext3_debug ("goal=%lu.\n", goal);
85 * First, test whether the goal block is free.
88 if (tmp == le32_to_cpu(gdp->bg_block_bitmap) ||
89 tmp == le32_to_cpu(gdp->bg_inode_bitmap) ||
90 in_range (tmp, le32_to_cpu(gdp->bg_inode_table),
91 - sb->u.ext3_sb.s_itb_per_group))
92 - ext3_error (sb, "ext3_new_block",
93 - "Allocating block in system zone - "
95 + EXT3_SB(sb)->s_itb_per_group)) {
96 + ext3_error(sb, __FUNCTION__,
97 + "Allocating block in system zone - block = %u", tmp);
99 + /* Note: This will potentially use up one of the handle's
100 + * buffer credits. Normally we have way too many credits,
101 + * so that is OK. In _very_ rare cases it might not be OK.
102 + * We will trigger an assertion if we run out of credits,
103 + * and we will have to do a full fsck of the filesystem -
104 + * better than randomly corrupting filesystem metadata.
106 + ext3_set_bit(j, bh->b_data);
111 /* The superblock lock should guard against anybody else beating
112 * us to this point! */
113 diff -ru lum-2.4.18-um30/fs/ext3/namei.c uml-2.4.18-12.5/fs/ext3/namei.c
114 --- lum-2.4.18-um30/fs/ext3/namei.c Fri Nov 9 15:25:04 2001
115 +++ uml-2.4.18-12.5/fs/ext3/namei.c Thu Sep 19 13:40:11 2002
118 dir->i_mtime = dir->i_ctime = CURRENT_TIME;
119 dir->u.ext3_i.i_flags &= ~EXT3_INDEX_FL;
120 - ext3_mark_inode_dirty(handle, dir);
121 dir->i_version = ++event;
122 + ext3_mark_inode_dirty(handle, dir);
123 BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
124 ext3_journal_dirty_metadata(handle, bh);
127 inode->i_op = &ext3_file_inode_operations;
128 inode->i_fop = &ext3_file_operations;
129 inode->i_mapping->a_ops = &ext3_aops;
130 - ext3_mark_inode_dirty(handle, inode);
131 err = ext3_add_nondir(handle, dentry, inode);
132 + ext3_mark_inode_dirty(handle, inode);
134 ext3_journal_stop(handle, dir);
137 err = PTR_ERR(inode);
138 if (!IS_ERR(inode)) {
139 init_special_inode(inode, mode, rdev);
140 - ext3_mark_inode_dirty(handle, inode);
141 err = ext3_add_nondir(handle, dentry, inode);
142 + ext3_mark_inode_dirty(handle, inode);
144 ext3_journal_stop(handle, dir);
149 inode->u.ext3_i.i_disksize = inode->i_size;
150 - ext3_mark_inode_dirty(handle, inode);
151 err = ext3_add_nondir(handle, dentry, inode);
152 + ext3_mark_inode_dirty(handle, inode);
154 ext3_journal_stop(handle, dir);
157 ext3_inc_count(handle, inode);
158 atomic_inc(&inode->i_count);
160 - ext3_mark_inode_dirty(handle, inode);
161 err = ext3_add_nondir(handle, dentry, inode);
162 + ext3_mark_inode_dirty(handle, inode);
163 ext3_journal_stop(handle, dir);