patch-2.3.51 linux/fs/affs/namei.c

Next file: linux/fs/affs/super.c
Previous file: linux/fs/adfs/super.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.50/linux/fs/affs/namei.c linux/fs/affs/namei.c
@@ -368,7 +368,7 @@
 	if (!empty_dir(bh,AFFS_I2HSIZE(inode)))
 		goto rmdir_done;
 	retval = -EBUSY;
-	if (!list_empty(&dentry->d_hash))
+	if (!d_unhashed(dentry))
 		goto rmdir_done;
 
 	if ((retval = affs_remove_header(bh,inode)) < 0)
@@ -557,6 +557,9 @@
 	}
 	if (S_ISDIR(old_inode->i_mode)) {
 		if (new_inode) {
+			retval = -EBUSY;
+			if (!d_unhashed(new_dentry))
+				goto end_rename;
 			retval = -ENOTEMPTY;
 			if (!empty_dir(new_bh,AFFS_I2HSIZE(new_inode)))
 				goto end_rename;

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