[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180119171636.GE3460072@devbig577.frc2.facebook.com>
Date: Fri, 19 Jan 2018 09:16:36 -0800
From: Tejun Heo <tj@...nel.org>
To: Ivan Vecera <ivecera@...hat.com>
Cc: linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
viro@...iv.linux.org.uk
Subject: Re: [PATCH driver-core] kernfs: fix regression in kernfs_fop_write
caused by wrong type
On Fri, Jan 19, 2018 at 09:18:54AM +0100, Ivan Vecera wrote:
> Commit b7ce40cff0b9 ("kernfs: cache atomic_write_len in
> kernfs_open_file") changes type of local variable 'len' from ssize_t
> to size_t. This change caused that the *ppos value is updated also
> when the previous write callback failed.
>
> Mentioned snippet:
> ...
> len = ops->write(...); <- return value can be negative
> ...
> if (len > 0) <- true here in this case
> *ppos += len;
> ...
>
> Fixes: b7ce40cff0b9 ("kernfs: cache atomic_write_len in kernfs_open_file")
> Signed-off-by: Ivan Vecera <ivecera@...hat.com>
Oops.
Acked-by: Tejun Heo <tj@...nel.org>
Thanks.
--
tejun
Powered by blists - more mailing lists