[PATCH] Wrong errno out of memory in open syscall

From: John Ripley (john@empeg.com)
Date: Fri Jan 28 2000 - 11:52:57 EST


Running under very tight memory conditions, I've been getting a strange
EACCES returned by open(...) - strange because it's called as root, the
file exists and isn't immutable. The only point in execution I can see
where this can be returned is in ext2_lookup. As far as I can tell,
iget(...) returns NULL when it can't allocate pages for an inode, but
ext2_lookup takes this as a permissions problem.

It's a simple one line patch, below.

--- linux-2.3.40/fs/ext2/namei.c Fri Jan 28 16:23:32 2000
+++ linux/fs/ext2/namei.c Fri Jan 28 16:40:41 2000
@@ -176,7 +176,7 @@
                inode = iget(dir->i_sb, ino);
 
                if (!inode)
- return ERR_PTR(-EACCES);
+ return ERR_PTR(-ENOMEM);
        }
        d_add(dentry, inode);
        return NULL;

-- 
John Ripley, empeg Ltd.
http://www.empeg.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 31 2000 - 21:00:21 EST