Commit 317d5a5f authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Al Viro

autofs4: switch autofs4_write to __kernel_write

Instead of playing games with the address limit..
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 8a2af064
...@@ -56,19 +56,14 @@ static int autofs4_write(struct autofs_sb_info *sbi, ...@@ -56,19 +56,14 @@ static int autofs4_write(struct autofs_sb_info *sbi,
struct file *file, const void *addr, int bytes) struct file *file, const void *addr, int bytes)
{ {
unsigned long sigpipe, flags; unsigned long sigpipe, flags;
mm_segment_t fs;
const char *data = (const char *)addr; const char *data = (const char *)addr;
ssize_t wr = 0; ssize_t wr = 0;
sigpipe = sigismember(&current->pending.signal, SIGPIPE); sigpipe = sigismember(&current->pending.signal, SIGPIPE);
/* Save pointer to user space and point back to kernel space */
fs = get_fs();
set_fs(KERNEL_DS);
mutex_lock(&sbi->pipe_mutex); mutex_lock(&sbi->pipe_mutex);
while (bytes) { while (bytes) {
wr = __vfs_write(file, data, bytes, &file->f_pos); wr = __kernel_write(file, data, bytes, &file->f_pos);
if (wr <= 0) if (wr <= 0)
break; break;
data += wr; data += wr;
...@@ -76,8 +71,6 @@ static int autofs4_write(struct autofs_sb_info *sbi, ...@@ -76,8 +71,6 @@ static int autofs4_write(struct autofs_sb_info *sbi,
} }
mutex_unlock(&sbi->pipe_mutex); mutex_unlock(&sbi->pipe_mutex);
set_fs(fs);
/* Keep the currently executing process from receiving a /* Keep the currently executing process from receiving a
* SIGPIPE unless it was already supposed to get one * SIGPIPE unless it was already supposed to get one
*/ */
......
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