[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: HFS+



Hi,

Elimar Riesebieter wrote:

Its is read- and writeable. I copied some movies and oggs to a
testdir created at /mnt. I could play the movies with mplayer and
hear the oggs with mp3blaster. After finishing that purely
unprofessional test i deletet all files in /mnt. There came a kmesg
telling:

zsh: sure you want to delete all the files in
/mnt/testwrite [yn]? y
HFS+-fs: request for non-existent node 10158080 in B*Tree
HFS+-fs: request for non-existent node 10158080 in B*Tree

Did you also create symlinks? I found a problem during creation of symlinks, which the attached patch fixes. If you didn't create symlinks, I would need more information.

bye, Roman
diff -pur -X /home/roman/nodiff linux-2.6.4-rc2.org/fs/hfsplus/dir.c linux-2.6.4-rc2/fs/hfsplus/dir.c
--- linux-2.6.4-rc2.org/fs/hfsplus/dir.c	2004-03-04 17:05:57.000000000 +0100
+++ linux-2.6.4-rc2/fs/hfsplus/dir.c	2004-03-04 16:49:30.000000000 +0100
@@ -399,6 +401,7 @@ int hfsplus_symlink(struct inode *dir, s
 	res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode);
 
 	if (!res) {
+		dentry->d_fsdata = (void *)inode->i_ino;
 		d_instantiate(dentry, inode);
 		mark_inode_dirty(inode);
 	}
@@ -424,6 +427,7 @@ int hfsplus_mknod(struct inode *dir, str
 		return res;
 	}
 	init_special_inode(inode, mode, rdev);
+	dentry->d_fsdata = (void *)inode->i_ino;
 	d_instantiate(dentry, inode);
 	mark_inode_dirty(inode);
 
diff -pur -X /home/roman/nodiff linux-2.6.4-rc2.org/fs/hfsplus/inode.c linux-2.6.4-rc2/fs/hfsplus/inode.c
--- linux-2.6.4-rc2.org/fs/hfsplus/inode.c	2004-03-04 17:05:57.000000000 +0100
+++ linux-2.6.4-rc2/fs/hfsplus/inode.c	2004-03-04 16:55:25.000000000 +0100
@@ -335,6 +337,14 @@ struct inode *hfsplus_new_inode(struct s
 	init_MUTEX(&HFSPLUS_I(inode).extents_lock);
 	atomic_set(&HFSPLUS_I(inode).opencnt, 0);
 	HFSPLUS_I(inode).flags = 0;
+	memset(HFSPLUS_I(inode).first_extents, 0, sizeof(hfsplus_extent_rec));
+	memset(HFSPLUS_I(inode).cached_extents, 0, sizeof(hfsplus_extent_rec));
+	HFSPLUS_I(inode).alloc_blocks = 0;
+	HFSPLUS_I(inode).first_blocks = 0;
+	HFSPLUS_I(inode).cached_start = 0;
+	HFSPLUS_I(inode).cached_blocks = 0;
+	HFSPLUS_I(inode).phys_size = 0;
+	HFSPLUS_I(inode).rsrc_inode = 0;
 	if (S_ISDIR(inode->i_mode)) {
 		inode->i_size = 2;
 		HFSPLUS_SB(sb).folder_count++;
@@ -346,14 +356,6 @@ struct inode *hfsplus_new_inode(struct s
 		inode->i_fop = &hfsplus_file_operations;
 		inode->i_mapping->a_ops = &hfsplus_aops;
 		HFSPLUS_I(inode).clump_blocks = HFSPLUS_SB(sb).data_clump_blocks;
-		memset(HFSPLUS_I(inode).first_extents, 0, sizeof(hfsplus_extent_rec));
-		memset(HFSPLUS_I(inode).cached_extents, 0, sizeof(hfsplus_extent_rec));
-		HFSPLUS_I(inode).alloc_blocks = 0;
-		HFSPLUS_I(inode).first_blocks = 0;
-		HFSPLUS_I(inode).cached_start = 0;
-		HFSPLUS_I(inode).cached_blocks = 0;
-		HFSPLUS_I(inode).phys_size = 0;
-		HFSPLUS_I(inode).rsrc_inode = 0;
 	} else if (S_ISLNK(inode->i_mode)) {
 		HFSPLUS_SB(sb).file_count++;
 		inode->i_op = &page_symlink_inode_operations;

Reply to: