* [PATCH v3 1/3] fs: direct-io: handle error in dio_end_io()
@ 2016-04-28 1:09 Ming Lei
2016-04-28 1:09 ` [PATCH v3 2/3] fs: direct-io: call .bi_end_io via bio_endio() Ming Lei
0 siblings, 1 reply; 4+ messages in thread
From: Ming Lei @ 2016-04-28 1:09 UTC (permalink / raw)
To: Jens Axboe, linux-kernel
Cc: linux-block, Christoph Hellwig, linux-btrfs, Ming Lei,
Alexander Viro, open list:FILESYSTEMS (VFS and infrastructure)
If error is passed to dio_end_io(), it should have been
dealt with. Unfortunately current code just ignores that
silently.
Only btrfs uses dio_end_io().
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
fs/direct-io.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/direct-io.c b/fs/direct-io.c
index 4720377..a8dd60a 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -352,6 +352,9 @@ void dio_end_io(struct bio *bio, int error)
{
struct dio *dio = bio->bi_private;
+ if (!bio->bi_error)
+ bio->bi_error = error;
+
if (dio->is_async)
dio_bio_end_aio(bio);
else
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v3 2/3] fs: direct-io: call .bi_end_io via bio_endio()
2016-04-28 1:09 [PATCH v3 1/3] fs: direct-io: handle error in dio_end_io() Ming Lei
@ 2016-04-28 1:09 ` Ming Lei
2016-05-02 14:50 ` Christoph Hellwig
0 siblings, 1 reply; 4+ messages in thread
From: Ming Lei @ 2016-04-28 1:09 UTC (permalink / raw)
To: Jens Axboe, linux-kernel
Cc: linux-block, Christoph Hellwig, linux-btrfs, Ming Lei,
Alexander Viro, open list:FILESYSTEMS (VFS and infrastructure)
bio_endio() is the graceful way to complete one bio.
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
fs/direct-io.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/fs/direct-io.c b/fs/direct-io.c
index a8dd60a..0a35e51 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -350,15 +350,10 @@ static void dio_bio_end_io(struct bio *bio)
*/
void dio_end_io(struct bio *bio, int error)
{
- struct dio *dio = bio->bi_private;
-
if (!bio->bi_error)
bio->bi_error = error;
- if (dio->is_async)
- dio_bio_end_aio(bio);
- else
- dio_bio_end_io(bio);
+ bio_endio(bio);
}
EXPORT_SYMBOL_GPL(dio_end_io);
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3 2/3] fs: direct-io: call .bi_end_io via bio_endio()
2016-04-28 1:09 ` [PATCH v3 2/3] fs: direct-io: call .bi_end_io via bio_endio() Ming Lei
@ 2016-05-02 14:50 ` Christoph Hellwig
2016-05-03 1:26 ` Ming Lei
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2016-05-02 14:50 UTC (permalink / raw)
To: Ming Lei
Cc: Jens Axboe, linux-kernel, linux-block, Christoph Hellwig,
linux-btrfs, Alexander Viro,
open list:FILESYSTEMS (VFS and infrastructure)
On Thu, Apr 28, 2016 at 09:09:48AM +0800, Ming Lei wrote:
> bio_endio() is the graceful way to complete one bio.
>
> Signed-off-by: Ming Lei <ming.lei@canonical.com>
> ---
> fs/direct-io.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/fs/direct-io.c b/fs/direct-io.c
> index a8dd60a..0a35e51 100644
> --- a/fs/direct-io.c
> +++ b/fs/direct-io.c
> @@ -350,15 +350,10 @@ static void dio_bio_end_io(struct bio *bio)
> */
> void dio_end_io(struct bio *bio, int error)
> {
> - struct dio *dio = bio->bi_private;
> -
> if (!bio->bi_error)
> bio->bi_error = error;
>
> - if (dio->is_async)
> - dio_bio_end_aio(bio);
> - else
> - dio_bio_end_io(bio);
> + bio_endio(bio);
> }
> EXPORT_SYMBOL_GPL(dio_end_io);
dio_end_io is only used by btrfs. So instead of this and the previous
patch you should just open code the error assignment and call to
bio_endio in btrfs.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 2/3] fs: direct-io: call .bi_end_io via bio_endio()
2016-05-02 14:50 ` Christoph Hellwig
@ 2016-05-03 1:26 ` Ming Lei
0 siblings, 0 replies; 4+ messages in thread
From: Ming Lei @ 2016-05-03 1:26 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, Linux Kernel Mailing List, linux-block, Btrfs BTRFS,
Alexander Viro, open list:FILESYSTEMS (VFS and infrastructure)
On Mon, May 2, 2016 at 10:50 PM, Christoph Hellwig <hch@infradead.org> wrote:
> On Thu, Apr 28, 2016 at 09:09:48AM +0800, Ming Lei wrote:
>> bio_endio() is the graceful way to complete one bio.
>
>
>
>>
>> Signed-off-by: Ming Lei <ming.lei@canonical.com>
>> ---
>> fs/direct-io.c | 7 +------
>> 1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/fs/direct-io.c b/fs/direct-io.c
>> index a8dd60a..0a35e51 100644
>> --- a/fs/direct-io.c
>> +++ b/fs/direct-io.c
>> @@ -350,15 +350,10 @@ static void dio_bio_end_io(struct bio *bio)
>> */
>> void dio_end_io(struct bio *bio, int error)
>> {
>> - struct dio *dio = bio->bi_private;
>> -
>> if (!bio->bi_error)
>> bio->bi_error = error;
>>
>> - if (dio->is_async)
>> - dio_bio_end_aio(bio);
>> - else
>> - dio_bio_end_io(bio);
>> + bio_endio(bio);
>> }
>> EXPORT_SYMBOL_GPL(dio_end_io);
>
> dio_end_io is only used by btrfs. So instead of this and the previous
> patch you should just open code the error assignment and call to
> bio_endio in btrfs.
OK.
Thanks,
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-05-03 1:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-28 1:09 [PATCH v3 1/3] fs: direct-io: handle error in dio_end_io() Ming Lei
2016-04-28 1:09 ` [PATCH v3 2/3] fs: direct-io: call .bi_end_io via bio_endio() Ming Lei
2016-05-02 14:50 ` Christoph Hellwig
2016-05-03 1:26 ` Ming Lei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).