patch-2.4.21 linux-2.4.21/fs/dcache.c
Next file: linux-2.4.21/fs/exec.c
Previous file: linux-2.4.21/fs/buffer.c
Back to the patch index
Back to the overall index
- Lines: 47
- Date:
2003-06-13 07:51:37.000000000 -0700
- Orig file:
linux-2.4.20/fs/dcache.c
- Orig date:
2002-11-28 15:53:15.000000000 -0800
diff -urN linux-2.4.20/fs/dcache.c linux-2.4.21/fs/dcache.c
@@ -977,21 +977,24 @@
namelen = dentry->d_name.len;
buflen -= namelen + 1;
if (buflen < 0)
- break;
+ return ERR_PTR(-ENAMETOOLONG);
end -= namelen;
memcpy(end, dentry->d_name.name, namelen);
*--end = '/';
retval = end;
dentry = parent;
}
+
return retval;
+
global_root:
namelen = dentry->d_name.len;
buflen -= namelen;
if (buflen >= 0) {
retval -= namelen-1; /* hit the slash */
memcpy(retval, dentry->d_name.name, namelen);
- }
+ } else
+ retval = ERR_PTR(-ENAMETOOLONG);
return retval;
}
@@ -1040,6 +1043,10 @@
cwd = __d_path(pwd, pwdmnt, root, rootmnt, page, PAGE_SIZE);
spin_unlock(&dcache_lock);
+ error = PTR_ERR(cwd);
+ if (IS_ERR(cwd))
+ goto out;
+
error = -ERANGE;
len = PAGE_SIZE + page - cwd;
if (len <= size) {
@@ -1049,6 +1056,8 @@
}
} else
spin_unlock(&dcache_lock);
+
+out:
dput(pwd);
mntput(pwdmnt);
dput(root);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)