Commit 64416848 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] revert- sys_setaltroot

We decided to do this a different way.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e734088b
......@@ -867,7 +867,7 @@ ENTRY(sys_call_table)
.long sys_mq_getsetattr
.long sys_ni_syscall /* reserved for kexec */
.long sys_waitid
.long sys_setaltroot /* 285 */
.long sys_ni_syscall /* 285 */ /* available */
.long sys_add_key
.long sys_request_key
.long sys_keyctl
......
......@@ -1527,7 +1527,7 @@ sys_call_table:
data8 sys_mq_getsetattr
data8 sys_ni_syscall // reserved for kexec_load
data8 sys_ni_syscall
data8 sys_setaltroot // 1270
data8 sys_ni_syscall // 1270
data8 sys_ni_syscall
data8 sys_ni_syscall
data8 sys_ni_syscall
......
......@@ -76,7 +76,7 @@ sys_call_table32:
.word sys_timer_delete, sys32_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy
/*270*/ .word sys32_io_submit, sys_io_cancel, compat_sys_io_getevents, sys32_mq_open, sys_mq_unlink
.word sys_mq_timedsend, sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid
/*280*/ .word sys_setaltroot, sys_add_key, sys_request_key, sys_keyctl
/*280*/ .word sys_ni_syscall, sys_add_key, sys_request_key, sys_keyctl
#endif /* CONFIG_COMPAT */
......@@ -142,7 +142,7 @@ sys_call_table:
.word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy
/*270*/ .word sys_io_submit, sys_io_cancel, sys_io_getevents, sys_mq_open, sys_mq_unlink
.word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid
/*280*/ .word sys_setaltroot, sys_add_key, sys_request_key, sys_keyctl
/*280*/ .word sys_nis_syscall, sys_add_key, sys_request_key, sys_keyctl
#if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \
defined(CONFIG_SOLARIS_EMUL_MODULE)
......
......@@ -913,20 +913,20 @@ static int __emul_lookup_dentry(const char *name, struct nameidata *nd)
return 1;
}
int __set_fs_altroot(const char *altroot)
void set_fs_altroot(void)
{
char *emul = __emul_prefix();
struct nameidata nd;
struct vfsmount *mnt = NULL, *oldmnt;
struct dentry *dentry = NULL, *olddentry;
int err;
if (!altroot)
if (!emul)
goto set_it;
err = path_lookup(altroot, LOOKUP_FOLLOW|LOOKUP_DIRECTORY|LOOKUP_NOALT, &nd);
err = path_lookup(emul, LOOKUP_FOLLOW|LOOKUP_DIRECTORY|LOOKUP_NOALT, &nd);
if (!err) {
mnt = nd.mnt;
dentry = nd.dentry;
} else {
return err;
}
set_it:
write_lock(&current->fs->lock);
......@@ -939,58 +939,6 @@ int __set_fs_altroot(const char *altroot)
dput(olddentry);
mntput(oldmnt);
}
return 0;
}
void set_fs_altroot(void)
{
char *emul = __emul_prefix();
__set_fs_altroot(emul);
}
asmlinkage long sys_setaltroot(const char __user * altroot)
{
char *emul = NULL;
int ret;
if (altroot) {
emul = getname(altroot);
if (IS_ERR(emul)) {
ret = PTR_ERR(emul);
goto out;
}
}
if (atomic_read(&current->fs->count) != 1) {
struct fs_struct *fsp, *ofsp;
fsp = copy_fs_struct(current->fs);
if (fsp == NULL) {
ret = -ENOMEM;
goto out_putname;
}
task_lock(current);
ofsp = current->fs;
current->fs = fsp;
task_unlock(current);
put_fs_struct(ofsp);
}
/*
* At that point we are guaranteed to be the sole owner of
* current->fs.
*/
ret = __set_fs_altroot(emul);
out_putname:
if (emul)
putname(emul);
out:
return ret;
}
int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata *nd)
......
......@@ -290,7 +290,7 @@
#define __NR_mq_getsetattr (__NR_mq_open+5)
#define __NR_sys_kexec_load 283
#define __NR_waitid 284
#define __NR_sys_setaltroot 285
/* #define __NR_sys_setaltroot 285 */
#define __NR_add_key 286
#define __NR_request_key 287
#define __NR_keyctl 288
......
......@@ -259,7 +259,6 @@
#define __NR_mq_getsetattr 1267
#define __NR_kexec_load 1268
#define __NR_vserver 1269
#define __NR_setaltroot 1270
#ifdef __KERNEL__
......
......@@ -298,7 +298,7 @@
#define __NR_mq_notify 277
#define __NR_mq_getsetattr 278
#define __NR_waitid 279
#define __NR_sys_setaltroot 280
/*#define __NR_sys_setaltroot 280 available (was setaltroot) */
#define __NR_add_key 281
#define __NR_request_key 282
#define __NR_keyctl 283
......
......@@ -490,7 +490,6 @@ asmlinkage long sys_nfsservctl(int cmd,
void __user *res);
asmlinkage long sys_syslog(int type, char __user *buf, int len);
asmlinkage long sys_uselib(const char __user *library);
asmlinkage long sys_setaltroot(const char __user *altroot);
asmlinkage long sys_ni_syscall(void);
asmlinkage long sys_add_key(const char __user *_type,
......
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