[Fwd: Patch for 2.1.45]

Bill Hawes (whawes@star.net)
Thu, 17 Jul 1997 11:15:12 -0400


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

--------------3C68E121D2DE5524625043F2
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Message-ID: <33CE1D6B.9847AF4C@star.net>
Date: Thu, 17 Jul 1997 09:26:03 -0400
From: Bill Hawes <whawes@star.net>
X-Mailer: Mozilla 4.0 [en] (WinNT; I)
MIME-Version: 1.0
To: Linus Torvalds <torvalds@transmeta.com>
CC: linux-kernel <linux-kernel@vger.rutgers.edu>
Subject: Patch for 2.1.45
X-Priority: 3 (Normal)
Content-Type: multipart/mixed; boundary="------------D184E329AAF1AEEE01744C0A"

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

Attached are a couple of quick patches for 2.1.45:

In fs/namei.c:
-- removed extra up semaphore in fs/namei.c

In fs/pipe.c
-- remove redundant setting of i_count
-- set i_mode instead of ORing, as i_mode isn't initialized.
-- check for d_alloc_root failure

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

--- linux-2.1.45/fs/namei.c.old Thu Jul 17 06:36:49 1997
+++ linux-2.1.45/fs/namei.c Thu Jul 17 09:04:34 1997
@@ -255,7 +255,6 @@
}
up(&dir->i_sem);
}
- up(&dir->i_sem);
return result;
}

--- linux-2.1.45/fs/pipe.c.old Thu Jul 17 06:36:50 1997
+++ linux-2.1.45/fs/pipe.c Thu Jul 17 07:09:55 1997
@@ -391,7 +391,6 @@
} else {
PIPE_BASE(*inode) = (char *) page;
inode->i_op = &pipe_inode_operations;
- inode->i_count = 1;
PIPE_WAIT(*inode) = NULL;
PIPE_START(*inode) = PIPE_LEN(*inode) = 0;
PIPE_RD_OPENERS(*inode) = PIPE_WR_OPENERS(*inode) = 0;
@@ -404,7 +403,8 @@
* that it already _is_ on the dirty list.
*/
inode->i_state = 1 << I_DIRTY;
- inode->i_mode |= S_IFIFO | S_IRUSR | S_IWUSR;
+ /* i_mode isn't cleared */
+ inode->i_mode = S_IFIFO | S_IRUSR | S_IWUSR;
inode->i_uid = current->fsuid;
inode->i_gid = current->fsgid;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
@@ -463,7 +463,10 @@
goto close_f12_inode_i;
j = error;

- f1->f_dentry = f2->f_dentry = dget(d_alloc_root(inode, NULL));
+ error = -ENOMEM;
+ if (!(f1->f_dentry = d_alloc_root(inode, NULL)))
+ goto close_f12_inode_i_j;
+ f2->f_dentry = dget(f1->f_dentry);

/* read file */
f1->f_pos = f2->f_pos = 0;
@@ -481,6 +484,8 @@
fd[1] = j;
return 0;

+close_f12_inode_i_j:
+ put_unused_fd(j);
close_f12_inode_i:
put_unused_fd(i);
close_f12_inode:

--------------D184E329AAF1AEEE01744C0A--

--------------3C68E121D2DE5524625043F2--