patch-2.1.127 linux/fs/hfs/inode.c

Next file: linux/fs/hfs/mdb.c
Previous file: linux/fs/hfs/hfs.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.126/linux/fs/hfs/inode.c linux/fs/hfs/inode.c
@@ -73,6 +73,9 @@
  */
 void hfs_put_inode(struct inode * inode)
 {
+	struct hfs_cat_entry *entry = HFS_I(inode)->entry;
+
+	hfs_cat_put(entry);
 	if (inode->i_count == 1) {
 	  struct hfs_hdr_layout *tmp = HFS_I(inode)->layout;
 
@@ -243,7 +246,7 @@
 	if (inode->i_dev != sb->s_dev) {
 	        iput(inode); /* automatically does an hfs_cat_put */
 		inode = NULL;
-	} else if (!inode->i_mode) {
+	} else if (!inode->i_mode || (*sys_entry == NULL)) {
 		/* Initialize the inode */
 		struct hfs_sb_info *hsb = HFS_SB(sb);
 
@@ -266,8 +269,7 @@
 		inode->i_mode &= ~hsb->s_umask;
 
 		if (!inode->i_mode) {
-			clear_inode(inode);
-			hfs_cat_put(entry);
+			iput(inode); /* does an hfs_cat_put */
 			inode = NULL;
 		} else
 			*sys_entry = dentry; /* cache dentry */
@@ -398,7 +400,7 @@
 		struct hfs_dir *hdir = &entry->u.dir;
 
 		inode->i_blocks = 0;
-		inode->i_size = hdir->files + hdir->dirs + 3;
+		inode->i_size = hdir->files + hdir->dirs + 4;
 		inode->i_mode = S_IRWXUGO | S_IFDIR;
 		HFS_I(inode)->dir_size = 1;
 		if (type == HFS_NAT_NDIR) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov