|
|
@@ -66,11 +66,12 @@ static int autofs4_write(struct autofs_sb_info *sbi,
|
|
|
set_fs(KERNEL_DS);
|
|
|
|
|
|
mutex_lock(&sbi->pipe_mutex);
|
|
|
- wr = __vfs_write(file, data, bytes, &file->f_pos);
|
|
|
- while (bytes && wr) {
|
|
|
+ while (bytes) {
|
|
|
+ wr = __vfs_write(file, data, bytes, &file->f_pos);
|
|
|
+ if (wr <= 0)
|
|
|
+ break;
|
|
|
data += wr;
|
|
|
bytes -= wr;
|
|
|
- wr = __vfs_write(file, data, bytes, &file->f_pos);
|
|
|
}
|
|
|
mutex_unlock(&sbi->pipe_mutex);
|
|
|
|