summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-08-29 05:27:07 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-08-29 05:27:07 +0000
commita60c6812feb6ba35b5b8a9ee8a5ca3d01d1fcd5f (patch)
tree2290ff15f280314a063f3dfc523742c8934c4259 /fs
parent1a1d77dd589de5a567fa95e36aa6999c704ceca4 (diff)
Merge with Linux 2.4.0-test8-pre1.
Diffstat (limited to 'fs')
-rw-r--r--fs/exec.c23
-rw-r--r--fs/ncpfs/ioctl.c11
-rw-r--r--fs/smbfs/inode.c2
-rw-r--r--fs/umsdos/emd.c4
4 files changed, 33 insertions, 7 deletions
diff --git a/fs/exec.c b/fs/exec.c
index c0df3a68b..f0c64b43a 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -496,6 +496,27 @@ static inline void flush_old_files(struct files_struct * files)
write_unlock(&files->file_lock);
}
+/*
+ * An execve() will automatically "de-thread" the process.
+ * Note: we don't have to hold the tasklist_lock to test
+ * whether we migth need to do this. If we're not part of
+ * a thread group, there is no way we can become one
+ * dynamically. And if we are, we only need to protect the
+ * unlink - even if we race with the last other thread exit,
+ * at worst the list_del_init() might end up being a no-op.
+ */
+static inline void de_thread(struct task_struct *tsk)
+{
+ if (!list_empty(&tsk->thread_group)) {
+ write_lock_irq(&tasklist_lock);
+ list_del_init(&tsk->thread_group);
+ write_unlock_irq(&tasklist_lock);
+ }
+
+ /* Minor oddity: this might stay the same. */
+ tsk->tgid = tsk->pid;
+}
+
int flush_old_exec(struct linux_binprm * bprm)
{
char * name;
@@ -534,6 +555,8 @@ int flush_old_exec(struct linux_binprm * bprm)
flush_thread();
+ de_thread(current);
+
if (bprm->e_uid != current->euid || bprm->e_gid != current->egid ||
permission(bprm->file->f_dentry->d_inode,MAY_READ))
current->dumpable = 0;
diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c
index 24e616396..f1c9099bc 100644
--- a/fs/ncpfs/ioctl.c
+++ b/fs/ncpfs/ioctl.c
@@ -16,6 +16,7 @@
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/highuid.h>
+#include <linux/vmalloc.h>
#include <linux/ncp_fs.h>
@@ -25,6 +26,8 @@
#define NCP_OBJECT_NAME_MAX_LEN 4096
/* maximum limit for ncp_privatedata_ioctl */
#define NCP_PRIVATE_DATA_MAX_LEN 8192
+/* maximum negotiable packet size */
+#define NCP_PACKET_SIZE_INTERNAL 65536
int ncp_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
@@ -50,11 +53,11 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
NCP_PACKET_SIZE - sizeof(struct ncp_request_header))) {
return -EINVAL;
}
- bouncebuffer = kmalloc(NCP_PACKET_SIZE, GFP_NFS);
+ bouncebuffer = vmalloc(NCP_PACKET_SIZE_INTERNAL);
if (!bouncebuffer)
return -ENOMEM;
if (copy_from_user(bouncebuffer, request.data, request.size)) {
- kfree(bouncebuffer);
+ vfree(bouncebuffer);
return -EFAULT;
}
ncp_lock_server(server);
@@ -67,7 +70,7 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
memcpy(server->packet, bouncebuffer, request.size);
result = ncp_request2(server, request.function,
- bouncebuffer, NCP_PACKET_SIZE);
+ bouncebuffer, NCP_PACKET_SIZE_INTERNAL);
if (result < 0)
result = -EIO;
else
@@ -78,7 +81,7 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
if (result >= 0)
if (copy_to_user(request.data, bouncebuffer, result))
result = -EFAULT;
- kfree(bouncebuffer);
+ vfree(bouncebuffer);
return result;
case NCP_IOC_CONN_LOGGED_IN:
diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c
index 708951949..b063860ee 100644
--- a/fs/smbfs/inode.c
+++ b/fs/smbfs/inode.c
@@ -445,7 +445,7 @@ smb_read_super(struct super_block *sb, void *raw_data, int silent)
memset(mnt, 0, sizeof(struct smb_mount_data_kernel));
strncpy(mnt->codepage.local_name, CONFIG_NLS_DEFAULT,
SMB_NLS_MAXNAMELEN);
- strncpy(mnt->codepage.local_name, CONFIG_SMB_NLS_REMOTE,
+ strncpy(mnt->codepage.remote_name, CONFIG_SMB_NLS_REMOTE,
SMB_NLS_MAXNAMELEN);
if (ver == SMB_MOUNT_OLDVERSION) {
diff --git a/fs/umsdos/emd.c b/fs/umsdos/emd.c
index a8de0def8..48515aa5f 100644
--- a/fs/umsdos/emd.c
+++ b/fs/umsdos/emd.c
@@ -142,7 +142,7 @@ int umsdos_emd_dir_readentry (struct dentry *demd, loff_t *pos, struct umsdos_di
recsize = umsdos_evalrecsize(p->name_len);
if (offs + recsize > PAGE_CACHE_SIZE) {
struct page *page2;
- int part = (page_address(page) + PAGE_CACHE_SIZE) - p->spare;
+ int part = (char *)(page_address(page) + PAGE_CACHE_SIZE) - p->spare;
page2 = read_cache_page(mapping, 1+(*pos>>PAGE_CACHE_SHIFT),
(filler_t*)mapping->a_ops->readpage, NULL);
if (IS_ERR(page2)) {
@@ -261,7 +261,7 @@ int umsdos_writeentry (struct dentry *parent, struct umsdos_info *info,
p->rdev = cpu_to_le16(entry->rdev);
p->mode = cpu_to_le16(entry->mode);
memcpy(p->name,entry->name,
- (page_address(page) + PAGE_CACHE_SIZE) - p->spare);
+ (char *)(page_address(page) + PAGE_CACHE_SIZE) - p->spare);
memcpy(page_address(page2),
entry->spare+PAGE_CACHE_SIZE-offs,
offs+info->recsize-PAGE_CACHE_SIZE);