Commit ca22d2b1 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.45pre9

parent c83fb0bd
......@@ -298,6 +298,7 @@ void clean_inode(struct inode *inode)
inode->i_op = NULL;
inode->i_nlink = 0;
inode->i_writecount = 0;
inode->i_size = 0;
memset(&inode->i_dquot, 0, sizeof(inode->i_dquot));
sema_init(&inode->i_sem, 1);
}
......
......@@ -313,15 +313,12 @@ asmlinkage int sys_chdir(const char * filename)
lock_kernel();
dentry = lookup_dentry(filename, NULL, 1);
dentry = namei(filename);
error = PTR_ERR(dentry);
if (IS_ERR(dentry))
goto out;
error = -ENOENT;
inode = dentry->d_inode;
if (!inode)
goto dput_and_out;
error = -ENOTDIR;
if (!S_ISDIR(inode->i_mode))
......@@ -390,15 +387,12 @@ asmlinkage int sys_chroot(const char * filename)
lock_kernel();
dentry = lookup_dentry(filename, NULL, 1);
dentry = namei(filename);
error = PTR_ERR(dentry);
if (IS_ERR(dentry))
goto out;
error = -ENOENT;
inode = dentry->d_inode;
if (!inode)
goto dput_and_out;
error = -ENOTDIR;
if (!S_ISDIR(inode->i_mode))
......
......@@ -728,16 +728,11 @@ int do_mount(kdev_t dev, const char * dev_name, const char * dir_name, const cha
return -EACCES;
/*flags |= MS_RDONLY;*/
dir_d = lookup_dentry(dir_name, NULL, 1);
dir_d = namei(dir_name);
error = PTR_ERR(dir_d);
if (IS_ERR(dir_d))
return error;
if (!dir_d->d_inode) {
dput(dir_d);
return -ENOENT;
}
if (dir_d->d_covers != dir_d) {
dput(dir_d);
return -EBUSY;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment