patch-2.4.0-test8 linux/fs/ext2/ialloc.c
Next file: linux/fs/ext2/inode.c
Previous file: linux/fs/ext2/balloc.c
Back to the patch index
Back to the overall index
- Lines: 63
- Date:
Tue Sep 5 14:07:29 2000
- Orig file:
v2.4.0-test7/linux/fs/ext2/ialloc.c
- Orig date:
Wed Aug 9 19:19:51 2000
diff -u --recursive --new-file v2.4.0-test7/linux/fs/ext2/ialloc.c linux/fs/ext2/ialloc.c
@@ -230,12 +230,12 @@
gdp->bg_used_dirs_count =
cpu_to_le16(le16_to_cpu(gdp->bg_used_dirs_count) - 1);
}
- mark_buffer_dirty(bh2, 1);
+ mark_buffer_dirty(bh2);
es->s_free_inodes_count =
cpu_to_le32(le32_to_cpu(es->s_free_inodes_count) + 1);
- mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1);
+ mark_buffer_dirty(sb->u.ext2_sb.s_sbh);
}
- mark_buffer_dirty(bh, 1);
+ mark_buffer_dirty(bh);
if (sb->s_flags & MS_SYNCHRONOUS) {
ll_rw_block (WRITE, 1, &bh);
wait_on_buffer (bh);
@@ -388,7 +388,7 @@
"bit already set for inode %d", j);
goto repeat;
}
- mark_buffer_dirty(bh, 1);
+ mark_buffer_dirty(bh);
if (sb->s_flags & MS_SYNCHRONOUS) {
ll_rw_block (WRITE, 1, &bh);
wait_on_buffer (bh);
@@ -398,9 +398,13 @@
ext2_error (sb, "ext2_new_inode",
"Free inodes count corrupted in group %d",
i);
- unlock_super (sb);
- iput (inode);
- return NULL;
+ if (sb->s_flags & MS_RDONLY) {
+ unlock_super (sb);
+ iput (inode);
+ return NULL;
+ }
+ gdp->bg_free_inodes_count = 0;
+ mark_buffer_dirty(bh2);
}
goto repeat;
}
@@ -411,6 +415,7 @@
"block_group = %d,inode=%d", i, j);
unlock_super (sb);
iput (inode);
+ *err = -EIO;
return NULL;
}
gdp->bg_free_inodes_count =
@@ -418,10 +423,10 @@
if (S_ISDIR(mode))
gdp->bg_used_dirs_count =
cpu_to_le16(le16_to_cpu(gdp->bg_used_dirs_count) + 1);
- mark_buffer_dirty(bh2, 1);
+ mark_buffer_dirty(bh2);
es->s_free_inodes_count =
cpu_to_le32(le32_to_cpu(es->s_free_inodes_count) - 1);
- mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1);
+ mark_buffer_dirty(sb->u.ext2_sb.s_sbh);
sb->s_dirt = 1;
inode->i_mode = mode;
inode->i_sb = sb;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)