From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: "Nuno Sá" <nuno.sa@analog.com>, linux-iio@vger.kernel.org
Subject: Re: [PATCH 1/3] iio: buffer: correctly return bytes written in output buffers
Date: Sat, 18 Feb 2023 14:07:30 +0000 [thread overview]
Message-ID: <20230218140730.22c83e0d@jic23-huawei> (raw)
In-Reply-To: <2e2ea230-792f-1487-e6c1-ae5a88b63f11@metafoo.de>
On Thu, 16 Feb 2023 05:40:46 -0800
Lars-Peter Clausen <lars@metafoo.de> wrote:
> On 2/16/23 02:14, Nuno Sá wrote:
> > If for some reason 'rb->access->write()' does not write the full
> > requested data and the O_NONBLOCK is set, we would return 'n' to
> > userspace which is not really truth. Hence, let's return the number of
> > bytes we effectively wrote.
> >
> > Fixes: 9eeee3b0bf190 ("iio: Add output buffer support")
> > Signed-off-by: Nuno Sá <nuno.sa@analog.com>
>
> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Applied to the fixes-togreg branch of iio.git and marked for stable.
Thanks,
J
>
> > ---
> > drivers/iio/industrialio-buffer.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> > index 228598b82a2f..c56cf748fde1 100644
> > --- a/drivers/iio/industrialio-buffer.c
> > +++ b/drivers/iio/industrialio-buffer.c
> > @@ -220,7 +220,7 @@ static ssize_t iio_buffer_write(struct file *filp, const char __user *buf,
> > } while (ret == 0);
> > remove_wait_queue(&rb->pollq, &wait);
> >
> > - return ret < 0 ? ret : n;
> > + return ret < 0 ? ret : written;
> > }
> >
> > /**
>
>
next prev parent reply other threads:[~2023-02-18 13:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-16 10:14 [PATCH 0/3] output buffer write fops fixes Nuno Sá
2023-02-16 10:14 ` [PATCH 1/3] iio: buffer: correctly return bytes written in output buffers Nuno Sá
2023-02-16 13:40 ` Lars-Peter Clausen
2023-02-18 14:07 ` Jonathan Cameron [this message]
2023-02-16 10:14 ` [PATCH 2/3] iio: buffer: make sure O_NONBLOCK is respected Nuno Sá
2023-02-16 14:00 ` Lars-Peter Clausen
2023-02-18 14:08 ` Jonathan Cameron
2023-02-16 10:14 ` [PATCH 3/3] iio: buffer: fix coding style warnings Nuno Sá
2023-02-16 14:07 ` Lars-Peter Clausen
2023-02-27 7:39 ` Nuno Sá
2023-03-04 13:03 ` Jonathan Cameron
2023-05-01 16:15 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230218140730.22c83e0d@jic23-huawei \
--to=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox