patch-2.1.113 linux/mm/filemap.c

Next file: linux/mm/memory.c
Previous file: linux/kernel/printk.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.112/linux/mm/filemap.c linux/mm/filemap.c
@@ -853,13 +853,15 @@
 	unsigned long count = desc->count;
 	struct file *file = (struct file *) desc->buf;
 	struct inode *inode = file->f_dentry->d_inode;
+	mm_segment_t old_fs;
 
 	if (size > count)
 		size = count;
 	down(&inode->i_sem);
+	old_fs = get_fs();
 	set_fs(KERNEL_DS);
 	written = file->f_op->write(file, area, size, &file->f_pos);
-	set_fs(USER_DS);
+	set_fs(old_fs);
 	up(&inode->i_sem);
 	if (written < 0) {
 		desc->error = written;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov