public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [CHECKER] warnings in fs/ext3/namei.c (2.4.19) where disk read errors get ignored, causing non-empty dir to be deleted
@ 2004-04-27  6:41 Junfeng Yang
  2004-04-27  7:44 ` [Ext2-devel] " Andreas Dilger
  0 siblings, 1 reply; 7+ messages in thread
From: Junfeng Yang @ 2004-04-27  6:41 UTC (permalink / raw)
  To: Linux Kernel Mailing List, ext2-devel, mc, Madanlal S Musuvathi,
	David L. Dill

Hi,

We checked EXT3 filesystem on 2.4.19 recently and found 2 cases that look
like bugs.  For both of the cases, disk read errors are ignored, which
appears to cause a non-empty directory to be wrongly deleted or a dir to
contain more than one entries with identical names.

I'm not sure if they are real bugs or not, so your confirmations
/clarifications are appericated.

Please let me know if anything isn't clear

all warnings are in file fs/ext3/namei.c

----------------------------------------------------------------------------
[BUG] A non-empty dir may be deleted because ext3_read errors are ignored
by ext3_find_entry.  empty_dir is called whenenver ext3_rmdir tries to
remove a directory.


static int empty_dir (struct inode * inode)
{
			bh = ext3_bread (NULL, inode,
				offset >> EXT3_BLOCK_SIZE_BITS(sb), 0, &err);
			if (!bh) {
#if 0
				ext3_error (sb, "empty_dir",
				"directory #%lu contains a hole at offset %lu",
					inode->i_ino, offset);
#endif
				offset += sb->s_blocksize;
ERROR --->			continue;
			}
			de = (struct ext3_dir_entry_2 *) bh->b_data;
		}

----------------------------------------------------------------------------
[BUG] A dir may end up containing more than one entries with identical
names because because disk read errors are ignored by ext3_find_entry.
ext3_find_entry is called by lots of other ext3 functions (ext3_add_entry,
ext3_unlink, ext3_rename)

static struct buffer_head * ext3_find_entry (struct dentry *dentry,
					struct ext3_dir_entry_2 ** res_dir)
{
.....
		if ((bh = bh_use[ra_ptr++]) == NULL)
			goto next;
		wait_on_buffer(bh);
		if (!buffer_uptodate(bh)) {
			/* read error, skip block & hope for the best */
			brelse(bh);
ERROR --->		goto next;
		}





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-05-03 17:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-27  6:41 [CHECKER] warnings in fs/ext3/namei.c (2.4.19) where disk read errors get ignored, causing non-empty dir to be deleted Junfeng Yang
2004-04-27  7:44 ` [Ext2-devel] " Andreas Dilger
2004-05-03  9:59   ` Pavel Machek
2004-05-03 14:10   ` Jörn Engel
2004-05-03 16:16     ` Andreas Dilger
2004-05-03 17:33       ` Jörn Engel
2004-05-03 17:54         ` Andreas Dilger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox