patch-2.3.6 linux/fs/hpfs/namei.c

Next file: linux/fs/hpfs/super.c
Previous file: linux/fs/hpfs/hpfs_fn.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.5/linux/fs/hpfs/namei.c linux/fs/hpfs/namei.c
@@ -482,14 +482,9 @@
 	de.hidden = new_name[0] == '.';
 
 	if (new_inode) {
-		hpfs_brelse4(&qbh);
-		if ((nde = map_dirent(new_dir, new_dir->i_hpfs_dno, (char *)new_name, new_len, NULL, &qbh1))) {
-			int r;
-			if ((r = hpfs_remove_dirent(old_dir, dno, dep, &qbh, 1)) != 2) {
-				if (!(nde = map_dirent(new_dir, new_dir->i_hpfs_dno, (char *)new_name, new_len, NULL, &qbh1))) {
-					hpfs_error(new_dir->i_sb, "hpfs_rename: could not find dirent #2");
-					goto end1;
-				}
+		int r;
+		if ((r = hpfs_remove_dirent(old_dir, dno, dep, &qbh, 1)) != 2) {
+			if ((nde = map_dirent(new_dir, new_dir->i_hpfs_dno, (char *)new_name, new_len, NULL, &qbh1))) {
 				new_inode->i_nlink = 0;
 				copy_de(nde, &de);
 				memcpy(nde->name, new_name, new_len);
@@ -497,11 +492,11 @@
 				hpfs_brelse4(&qbh1);
 				goto end;
 			}
-			err = r == 2 ? -ENOSPC : r == 1 ? -EFSERROR : 0;
+			hpfs_error(new_dir->i_sb, "hpfs_rename: could not find dirent");
+			err = -EFSERROR;
 			goto end1;
 		}
-		hpfs_error(new_dir->i_sb, "hpfs_rename: could not find dirent");
-		err = -EFSERROR;
+		err = r == 2 ? -ENOSPC : r == 1 ? -EFSERROR : 0;
 		goto end1;
 	}
 

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