patch-2.2.6 linux/fs/ncpfs/dir.c

Next file: linux/fs/ncpfs/inode.c
Previous file: linux/fs/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.5/linux/fs/ncpfs/dir.c linux/fs/ncpfs/dir.c
@@ -303,6 +303,8 @@
 
         memset(&ia,0,sizeof(struct iattr));
         ia.ia_mode = old_dentry->d_inode->i_mode;
+	if (S_ISDIR(ia.ia_mode))
+		goto leave_me;
         ia.ia_mode |= NCP_SERVER(old_dir)->m.file_mode & 0222;  /* set write bits */
         ia.ia_valid = ATTR_MODE;
 
@@ -1125,7 +1127,8 @@
                                 old_dentry->d_name.name,new_dentry->d_name.name);
                         ncp_invalid_dir_cache(old_dir);
                         ncp_invalid_dir_cache(new_dir);
-                        d_move(old_dentry,new_dentry);
+			if (!S_ISDIR(old_dentry->d_inode->i_mode))
+				d_move(old_dentry,new_dentry);
                 }
 	} else {
 		if (error == 0x9E)

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