patch-2.2.3 linux/fs/vfat/namei.c

Next file: linux/include/asm-alpha/semaphore-helper.h
Previous file: linux/fs/smbfs/cache.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.2/linux/fs/vfat/namei.c linux/fs/vfat/namei.c
@@ -506,10 +506,10 @@
 			continue;
 		if (memcmp(de->name,name,MSDOS_NAME))
 			continue;
-		brelse(bh);
+		fat_brelse(dir->i_sb,bh);
 		return 0;
 	}
-	brelse(bh);
+	fat_brelse(dir->i_sb,bh);
 	return -ENOENT;
 }
 
@@ -1659,6 +1659,9 @@
 		res = vfat_remove_entry(new_dir,&sinfo,new_inode);
 		if (res)
 			goto rename_done;
+
+		if (is_dir)
+			new_dir->i_nlink--;
 	}
 
 	/* Serious lossage here. FAT uses braindead inode numbers scheme,
@@ -1669,9 +1672,6 @@
 	 * in icache and as a part of stat output. It would kill all the
 	 * 'busy' stuff on the spot. Later.
 	 */
-
-	if (is_dir)
-		new_dir->i_nlink--;
 
 	res = vfat_find(new_dir,&new_dentry->d_name,1,is_dir,&sinfo);
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)