Skip to contentSkip to conversation

FS-corruption on ext3 with HTrees

DISCUSSION Kiran-Kumar Muniswamy-Reddy 2 participants 2 messages Sep 24, 2003 VFS

lore
Share & tools
lore
#0 lore raw

Hi,

I'm working with Prof. Zadok on versionfs, a stackable versioning file system. I face some problems with the unlink operation on ext3 with htree.

On an unlink, I make a copy of the file (version/backup) and unlink the original file. But some files that have been unlinked are "linked back" to another file. For example, on deleting the file 'foo', the file itself is deleted and its backup is made, but "foo" points to a seemingly unrelated inode.

On fscking the file system, fsck reports that the inode which "foo" now points to has an incorrect refcount and increments that particular inode's ref-count to 2.

There was a mail on ext3-users about a year ago reporting a similar problem:

https://listman.redhat.com/archives/ext3-users/2002-October/msg00053.html

I don't know if it was fixed.

In my code, I'm using only vfs calls and do nothing that is specific to ext3. This works fine on ext3 and ext2 without HTrees, but this behavior occurs on ext3 with Htrees. Here's a high level description of what I'm doing in versionfs_unlink:

* down the isem of parent directory
* compute the name of the version file
* lookup the name using lookup_one_len
* create the version'ed file using vfs_create
* open the original file using dentry_open
* copy the data from the original file to the version file
* close the original file and version file
* upping the isem of the parent directory
* call vfs_unlink as it would have been called normally

Let me know if I'm doing something wrong.

Thanks,
Kiran,
SUNY Stony Brook.

#1 lore raw

I am wondering is your versionfs GPL? If it is, why not just show me the code?

It is very hard for others try to figure out what is wrong from your description without the source. Detail is what matters.

Chris

Quoted 52 lines

From Kiran-Kumar Muniswamy-Reddy <[email protected]> on 24 Sep 2003:

Hi,

I'm working with Prof. Zadok on versionfs, a stackable versioning file system. I face some problems with the unlink operation on ext3 with htree.

On an unlink, I make a copy of the file (version/backup) and unlink the original file. But some files that have been unlinked are "linked back" to another file. For example, on deleting the file 'foo', the file itself is deleted and its backup is made, but "foo" points to a seemingly unrelated inode.

On fscking the file system, fsck reports that the inode which "foo" now points to has an incorrect refcount and increments that particular inode's ref-count to 2.

There was a mail on ext3-users about a year ago reporting a similar problem:

https://listman.redhat.com/archives/ext3-users/2002-October/msg00053.html

I don't know if it was fixed.

In my code, I'm using only vfs calls and do nothing that is specific to ext3. This works fine on ext3 and ext2 without HTrees, but this behavior occurs on ext3 with Htrees. Here's a high level description of what I'm doing in versionfs_unlink:

* down the isem of parent directory
* compute the name of the version file
* lookup the name using lookup_one_len
* create the version'ed file using vfs_create
* open the original file using dentry_open
* copy the data from the original file to the version file
* close the original file and version file
* upping the isem of the parent directory
* call vfs_unlink as it would have been called normally

Let me know if I'm doing something wrong.

Thanks,
Kiran,
SUNY Stony Brook.

_______________________________________________
Ext3-users mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/ext3-users