Date: Thu, 6 Jul 2000 15:28:27 +0100 From: "Stephen C. Tweedie" <sct@redhat.com> To: linux-fsdevel@vger.rutgers.edu, linux-kernel@vger.rutgers.edu Subject: PATCH: ext3-0.0.2f released --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On Wed, Jul 05, 2000 at 09:18:55PM +0100, Stephen C. Tweedie wrote: > > ext3-0.0.2e has been uploaded to > ftp://ftp.uk.linux.org/pub/linux/sct/fs/jfs/ext3-0.0.2e.tar.gz This has now been superceded by ext3-0.0.2f (patch enclosed), which fixes a major bug --- the new truncate code in 0.0.2e did not propagate extensions of existing directories to disk (existing, sufficiently-padded directories would not be affected, but appending a lot of new dirents to an existing directory could leave the new dirents unreachable after a reboot). e2fsck should be able to restore the directories if this has caught anybody --- the contents of the directories was not lost, only the update of the on-disk copy of the directory's size was being missed. I'll push a complete set of clean ext3-0.0.2f patches out to ftp.uk.linux.org shortly, but in the mean time please apply the patch below if you are running 0.0.2e. Andreas, I also found that your orphan list code was missing the case of a "rmdir" of a directory still being used as the working directory of an existing process. 0.0.2f should also clean up such a case on reboot. Cheers, Stephen --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ext3-0.0.2eto0.0.2f.diff" --- linux-2.2.16-3.ext3/fs/ext3/namei.c.~1~ Thu Jul 6 12:55:50 2000 +++ linux-2.2.16-3.ext3/fs/ext3/namei.c Thu Jul 6 15:13:25 2000 @@ -255,6 +255,7 @@ de->inode = 0; de->rec_len = le16_to_cpu(sb->s_blocksize); dir->i_size = offset + sb->s_blocksize; + dir->u.ext3_i.i_disksize = dir->i_size; dir->u.ext3_i.i_flags &= ~EXT3_BTREE_FL; ext3_mark_inode_dirty(handle, dir); /* Just keep the buffer reserved for now. */ @@ -405,7 +406,7 @@ d_instantiate(dentry, inode); out: - ext3_journal_stop(handle, inode); + ext3_journal_stop(handle, dir); return err; } @@ -465,7 +466,7 @@ d_instantiate(dentry, inode); brelse(bh); out_stop: - ext3_journal_stop(handle, inode); + ext3_journal_stop(handle, dir); return err; out_no_entry: @@ -494,7 +495,7 @@ goto out_stop; inode->i_op = &ext3_dir_inode_operations; - inode->i_size = inode->i_sb->s_blocksize; + inode->i_size = inode->u.ext3_i.i_disksize = inode->i_sb->s_blocksize; inode->i_blocks = 0; dir_block = ext3_bread (handle, inode, 0, 1, &err); if (!dir_block) { @@ -546,7 +547,7 @@ err = 0; out_stop: - ext3_journal_stop(handle, inode); + ext3_journal_stop(handle, dir); out: return err; @@ -659,6 +660,7 @@ inode->i_version = ++global_event; inode->i_nlink = 0; inode->i_size = 0; + ext3_orphan_add(handle, inode); ext3_mark_inode_dirty(handle, inode); dir->i_nlink--; inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; @@ -801,7 +803,7 @@ journal_dirty_metadata(handle, name_block); brelse (name_block); } - inode->i_size = i; + inode->i_size = inode->u.ext3_i.i_disksize = i; ext3_mark_inode_dirty(handle, inode); bh = ext3_add_entry (handle, dir, dentry->d_name.name, dentry->d_name.len, &de, &err); --3V7upXqbjpZ4EhLz-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/