lkml.org 
[lkml]   [1997]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectpatch for 2.1.48 fs/ext2/namei.c
There are several error exits in ext2_new_inode that don't set an error
return code, so that it's possible for ext2_create et al to falsely
indicate a successful return without having done a d_instantiate. This
could lead to problems later on ... I think some recent oops reports
might be related.

The attached patch fixes this by using -EIO as a default error, though
it would be better to get Stephen Tweedie to move his ext2 error patch
forward to 2.1.48.

Regards,
Bill--- fs/ext2/namei.c.old Tue Aug 5 10:46:00 1997
+++ fs/ext2/namei.c Thu Aug 7 15:29:41 1997
@@ -351,10 +351,13 @@
struct inode * inode;
struct buffer_head * bh;
struct ext2_dir_entry * de;
- int err;
+ int err = -EIO;

if (!dir)
return -ENOENT;
+ /*
+ * N.B. Several error exits in ext2_new_inode don't set err.
+ */
inode = ext2_new_inode (dir, mode, &err);
if (!inode)
return err;
@@ -386,7 +389,7 @@
struct inode * inode;
struct buffer_head * bh;
struct ext2_dir_entry * de;
- int err;
+ int err = -EIO;

if (!dir)
return -ENOENT;
@@ -443,7 +446,7 @@
struct inode * inode;
struct buffer_head * bh, * dir_block;
struct ext2_dir_entry * de;
- int err;
+ int err = -EIO;

if (dentry->d_name.len > EXT2_NAME_LEN)
return -ENAMETOOLONG;
@@ -714,8 +717,7 @@
struct inode * inode = NULL;
struct buffer_head * bh = NULL, * name_block = NULL;
char * link;
- int i, err;
- int l;
+ int i, l, err = -EIO;
char c;

if (!(inode = ext2_new_inode (dir, S_IFLNK, &err))) {
\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.035 / U:0.916 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site