[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANaxB-wWRaQYz5cku5iQ=HpA34Fzijz0UvYvFJnbCgrXHwX12A@mail.gmail.com>
Date: Mon, 23 May 2016 14:50:17 -0700
From: Andrei Vagin <avagin@...il.com>
To: Ian Kent <raven@...maw.net>
Cc: autofs@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] autofs: don't stuck in a loop if vfs_write returns an error
Hi Ian,
When are you going to apply this patch? We can't test linux-next without it.
Thanks,
Andrew
On Fri, Apr 1, 2016 at 12:37 AM, Ian Kent <raven@...maw.net> wrote:
> On Thu, 2016-03-31 at 22:12 -0700, Andrey Vagin wrote:
>> From: Andrey Vagin <avagin@...nvz.org>
>>
>> __vfs_write() returns a negative value in a error case.
>
> Ha, right, I'll send this along to Andrew with my next series which
> should be soon.
>
>>
>> Cc: Ian Kent <raven@...maw.net>
>> Signed-off-by: Andrey Vagin <avagin@...nvz.org>
>> ---
>> fs/autofs4/waitq.c | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
>> index 0146d91..631f155 100644
>> --- a/fs/autofs4/waitq.c
>> +++ b/fs/autofs4/waitq.c
>> @@ -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);
>>
Powered by blists - more mailing lists