patch-2.4.21 linux-2.4.21/fs/umsdos/namei.c

Next file: linux-2.4.21/include/asm-alpha/agp_backend.h
Previous file: linux-2.4.21/fs/umsdos/dir.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/fs/umsdos/namei.c linux-2.4.21/fs/umsdos/namei.c
@@ -617,15 +617,19 @@
 temp->d_parent->d_name.name, temp->d_name.name, ret);
 			goto cleanup;
 		}
-		/* mark the inode as a hardlink */
-		oldinode->u.umsdos_i.i_is_hlink = 1;
-
 		/*
 		 * Capture the path to the hidden link.
 		 */
 		path = umsdos_d_path(olddentry, (char *) buffer, PAGE_SIZE);
+		if (IS_ERR(path)) {
+			ret = PTR_ERR(path);
+			goto cleanup;
+		}
 Printk(("umsdos_link: hidden link path=%s\n", path));
 
+		/* mark the inode as a hardlink */
+		oldinode->u.umsdos_i.i_is_hlink = 1;
+
 		/*
 		 * Recreate a dentry for the original name and symlink it,
 		 * then symlink the new dentry. Don't give up if one fails,
@@ -694,6 +698,8 @@
 		goto out_unlock;
 	path = umsdos_d_path(temp, (char *) buffer, PAGE_SIZE);
 	dput(temp);
+	if (IS_ERR(path))
+		goto out_unlock;
 Printk(("umsdos_link: %s/%s already hidden, path=%s\n",
 olddentry->d_parent->d_name.name, olddentry->d_name.name, path));
 

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