patch for 2.1.50 fs/proc/openpromfs

Bill Hawes (whawes@star.net)
Mon, 18 Aug 1997 21:59:42 -0400


This is a multi-part message in MIME format.
--------------B0B4267C630A7637C59AD66D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The 2.1.50 proc/openpromfs create routine was still iputting the dir
inode, which is a no-no in this age of dentries.

I'm not sure how many people are using openpromfs, but the extra iput
would probably mess up the inodes ...

Regards,
Bill
--------------B0B4267C630A7637C59AD66D
Content-Type: text/plain; charset=us-ascii; name="openprom_50-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="openprom_50-patch"

--- fs/proc/openpromfs.c.old Tue Aug 12 07:45:37 1997
+++ fs/proc/openpromfs.c Mon Aug 18 21:50:25 1997
@@ -840,26 +840,19 @@

if (!dir)
return -ENOENT;
- if (dentry->d_name.len > 256) {
- iput (dir);
+ if (dentry->d_name.len > 256)
return -EINVAL;
- }
- if (aliases_nodes == ALIASES_NNODES) {
- iput (dir);
+ if (aliases_nodes == ALIASES_NNODES)
return -EIO;
- }
p = kmalloc (dentry->d_name.len + 1, GFP_KERNEL);
- if (!p) {
- iput (dir);
+ if (!p)
return -ENOMEM;
- }
strncpy (p, dentry->d_name.name, dentry->d_name.len);
p [dentry->d_name.len] = 0;
alias_names [aliases_nodes++] = p;
inode = proc_get_inode (dir->i_sb,
NODEP2INO(NODE(dir->i_ino).first_prop)
+ aliases_nodes, 0);
- iput (dir);
if (!inode)
return -EINVAL;
inode->i_mode = S_IFREG | S_IRUGO | S_IWUSR;

--------------B0B4267C630A7637C59AD66D--