Index: linux-2.6.5-7.201-full/include/linux/ext3_fs.h =================================================================== --- linux-2.6.5-7.201-full.orig/include/linux/ext3_fs.h 2006-08-09 17:59:34.000000000 +0400 +++ linux-2.6.5-7.201-full/include/linux/ext3_fs.h 2006-08-22 12:35:55.000000000 +0400 @@ -793,6 +793,7 @@ extern void ext3_put_super (struct super extern void ext3_write_super (struct super_block *); extern void ext3_write_super_lockfs (struct super_block *); extern void ext3_unlockfs (struct super_block *); +extern void ext3_commit_super (struct super_block *, struct ext3_super_block *, int); extern int ext3_remount (struct super_block *, int *, char *); extern int ext3_statfs (struct super_block *, struct kstatfs *); Index: linux-2.6.5-7.201-full/fs/ext3/super.c =================================================================== --- linux-2.6.5-7.201-full.orig/fs/ext3/super.c 2006-08-09 17:59:37.000000000 +0400 +++ linux-2.6.5-7.201-full/fs/ext3/super.c 2006-08-09 17:59:37.000000000 +0400 @@ -39,7 +39,7 @@ static int ext3_load_journal(struct super_block *, struct ext3_super_block *); static int ext3_create_journal(struct super_block *, struct ext3_super_block *, int); -static void ext3_commit_super (struct super_block * sb, +void ext3_commit_super (struct super_block * sb, struct ext3_super_block * es, int sync); static void ext3_mark_recovery_complete(struct super_block * sb, @@ -1781,7 +1781,7 @@ static int ext3_create_journal(struct su return 0; } -static void ext3_commit_super (struct super_block * sb, +void ext3_commit_super (struct super_block * sb, struct ext3_super_block * es, int sync) { Index: linux-2.6.5-7.201-full/fs/ext3/namei.c =================================================================== --- linux-2.6.5-7.201-full.orig/fs/ext3/namei.c 2006-08-09 17:59:37.000000000 +0400 +++ linux-2.6.5-7.201-full/fs/ext3/namei.c 2006-08-09 17:59:37.000000000 +0400 @@ -1598,7 +1598,7 @@ static int ext3_delete_entry (handle_t * struct buffer_head * bh) { struct ext3_dir_entry_2 * de, * pde; - int i; + int i, err; i = 0; pde = NULL; @@ -1608,7 +1608,9 @@ static int ext3_delete_entry (handle_t * return -EIO; if (de == de_del) { BUFFER_TRACE(bh, "get_write_access"); - ext3_journal_get_write_access(handle, bh); + err = ext3_journal_get_write_access(handle, bh); + if (err) + return err; if (pde) pde->rec_len = cpu_to_le16(le16_to_cpu(pde->rec_len) + Index: linux-2.6.5-7.201-full/fs/ext3/xattr.c =================================================================== --- linux-2.6.5-7.201-full.orig/fs/ext3/xattr.c 2006-07-14 01:53:23.000000000 +0400 +++ linux-2.6.5-7.201-full/fs/ext3/xattr.c 2006-08-09 17:59:37.000000000 +0400 @@ -107,7 +107,7 @@ ext3_xattr_register(int name_index, stru { int error = -EINVAL; - if (name_index > 0 && name_index <= EXT3_XATTR_INDEX_MAX) { + if (name_index > 0 && name_index < EXT3_XATTR_INDEX_MAX) { write_lock(&ext3_handler_lock); if (!ext3_xattr_handlers[name_index-1]) { ext3_xattr_handlers[name_index-1] = handler; Index: linux-2.6.5-7.201-full/fs/ext3/inode.c =================================================================== --- linux-2.6.5-7.201-full.orig/fs/ext3/inode.c 2006-07-14 01:53:22.000000000 +0400 +++ linux-2.6.5-7.201-full/fs/ext3/inode.c 2006-08-22 12:35:28.000000000 +0400 @@ -1517,9 +1517,14 @@ out_stop: if (end > inode->i_size) { ei->i_disksize = end; i_size_write(inode, end); - err = ext3_mark_inode_dirty(handle, inode); - if (!ret) - ret = err; + /* + * We're going to return a positive `ret' + * here due to non-zero-length I/O, so there's + * no way of reporting error returns from + * ext3_mark_inode_dirty() to userspace. So + * ignore it. + */ + ext3_mark_inode_dirty(handle, inode); } } err = ext3_journal_stop(handle); @@ -1811,8 +1816,18 @@ ext3_clear_blocks(handle_t *handle, stru ext3_mark_inode_dirty(handle, inode); ext3_journal_test_restart(handle, inode); if (bh) { + int err; BUFFER_TRACE(bh, "retaking write access"); - ext3_journal_get_write_access(handle, bh); + err = ext3_journal_get_write_access(handle, bh); + if (err) { + struct super_block *sb = inode->i_sb; + struct ext3_super_block *es = EXT3_SB(sb)->s_es; + printk (KERN_CRIT"EXT3-fs: can't continue truncate\n"); + EXT3_SB(sb)->s_mount_state |= EXT3_ERROR_FS; + es->s_state |= cpu_to_le16(EXT3_ERROR_FS); + ext3_commit_super(sb, es, 1); + return; + } } }