public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [Ext2-devel] bug in ext3 htree rename: doesn't delete old nam e, leaves ino with bad nlink
@ 2002-11-06  9:03 Christopher Li
  2002-11-06  9:44 ` Andreas Dilger
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Li @ 2002-11-06  9:03 UTC (permalink / raw)
  To: 'Jeremy Fitzhardinge ', Christopher Li
  Cc: 'Ext2 devel ', 'Linux Kernel List '

 

-----Original Message-----
From: Jeremy Fitzhardinge
To: chrisl@vmware.com
Cc: Ext2 devel; Linux Kernel List
Sent: 11/5/02 9:02 PM
Subject: Re: [Ext2-devel] bug in ext3 htree rename: doesn't delete old name,
leaves ino with bad nlink

On Tue, 2002-11-05 at 13:24, chrisl@vmware.com wrote:

>Thanks for looking at it so quickly.  I want ext3+htree to stabilise as
>quickly as possible, and since I had a nice reproducible bug, I may as
>well make the most of it.

That save me a lot of time to duplicate the bug. I want to make htree
stablilise quickly also.


>Yes, I would have guessed that it was related to a tree split.  The
>interesting thing to me is that it happened twice in this particular
>run, and yet it must be a fairly uncommon occurrence overall (otherwise
>it would have been reported before).  I wonder if it really is a rare
>event, or it has just gone unnoticed?

It is a relative rare event. Let's see. To make this happen, rename need to
add new entry and split the dir entry block. Depend on how much space left
on
your leaf block. Let's say your average filename length is 9. A dir entry
record is 24 bytes. A 4K block can have 170 entries. Given htree after split
is half full. Chance to hit a split on add an entry is about 1/85.
Assuem you have N leaf dir entry blocks in your dir. Chance of the old file
entry in the same block of new file entry is 1/N. Chance of old file
not in the same block after split is 1/2.

So total chance is about 1/(170*N). When you have relative small
direcotrys, the chance is bigger than huge directorys.


>Update it in what way?  In principle a rename is an atomic operation, so
>other things shouldn't be able to observe the directory in an
>intermediate state.

I mean when split dir entry blocks, it will move the dir entry inside
that block. I am not clear about do we need to invalidate the dentry
cache for those changed entry. I need to check the source.

Cheers

Chris





	J




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

* Re: [Ext2-devel] bug in ext3 htree rename: doesn't delete old nam e, leaves ino with bad nlink
  2002-11-06  9:03 [Ext2-devel] bug in ext3 htree rename: doesn't delete old nam e, leaves ino with bad nlink Christopher Li
@ 2002-11-06  9:44 ` Andreas Dilger
  2002-11-07  1:26   ` Christopher Li
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Dilger @ 2002-11-06  9:44 UTC (permalink / raw)
  To: Christopher Li
  Cc: 'Jeremy Fitzhardinge ', 'Ext2 devel ',
	'Linux Kernel List '

On Nov 06, 2002  01:03 -0800, Christopher Li wrote:
> Jeremy Fitzhardinge wrote:
> >Update it in what way?  In principle a rename is an atomic operation, so
> >other things shouldn't be able to observe the directory in an
> >intermediate state.
> 
> I mean when split dir entry blocks, it will move the dir entry inside
> that block. I am not clear about do we need to invalidate the dentry
> cache for those changed entry. I need to check the source.

I am not aware of anything stored in a dentry which would be affected
by the directory or changes therein at all.  The file name is allocated
as part of the dentry, and also only holds an inode pointer.

Cheers, Andreas
--
Andreas Dilger
http://www-mddsp.enel.ucalgary.ca/People/adilger/
http://sourceforge.net/projects/ext2resize/


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

* Re: [Ext2-devel] bug in ext3 htree rename: doesn't delete old nam e, leaves ino with bad nlink
  2002-11-06  9:44 ` Andreas Dilger
@ 2002-11-07  1:26   ` Christopher Li
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Li @ 2002-11-07  1:26 UTC (permalink / raw)
  To: 'Jeremy Fitzhardinge ', 'Ext2 devel ',
	'Linux Kernel List '

On Wed, Nov 06, 2002 at 02:44:25AM -0700, Andreas Dilger wrote:

> I am not aware of anything stored in a dentry which would be affected
> by the directory or changes therein at all.  The file name is allocated
> as part of the dentry, and also only holds an inode pointer.

Thanks for the explain. Then there is no problem then.

Chris




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

end of thread, other threads:[~2002-11-06 22:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-06  9:03 [Ext2-devel] bug in ext3 htree rename: doesn't delete old nam e, leaves ino with bad nlink Christopher Li
2002-11-06  9:44 ` Andreas Dilger
2002-11-07  1:26   ` Christopher Li

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