Skip to content

Commit

Permalink
autofs4: switch autofs4_write to __kernel_write
Browse files Browse the repository at this point in the history
Instead of playing games with the address limit..

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Christoph Hellwig authored and Al Viro committed Sep 4, 2017
1 parent 8a2af06 commit 317d5a5
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions fs/autofs4/waitq.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,21 @@ static int autofs4_write(struct autofs_sb_info *sbi,
struct file *file, const void *addr, int bytes)
{
unsigned long sigpipe, flags;
mm_segment_t fs;
const char *data = (const char *)addr;
ssize_t wr = 0;

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);
while (bytes) {
wr = __vfs_write(file, data, bytes, &file->f_pos);
wr = __kernel_write(file, data, bytes, &file->f_pos);
if (wr <= 0)
break;
data += wr;
bytes -= wr;
}
mutex_unlock(&sbi->pipe_mutex);

set_fs(fs);

/* Keep the currently executing process from receiving a
* SIGPIPE unless it was already supposed to get one
*/
Expand Down

0 comments on commit 317d5a5

Please sign in to comment.