linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nicklin <jnicklin@blockbridge.com>
To: linux-kernel@vger.kernel.org
Subject: BUG: aio/direct-io data corruption in 4.7
Date: Mon, 12 Sep 2016 14:38:03 -0400	[thread overview]
Message-ID: <CAHex0corhi5He41qdenWovgkVyD5Rpj0YLxeN+-ex4cOycqKdQ@mail.gmail.com> (raw)

In 4.7.2, the kernel is acknowledging block writes that have not
completed to disk. To reproduce: create an MD array, run FIO (direct +
libaio), and pull all drives. FIO will continue to run without
receiving I/O errors. I have also reproduced the bug using physical
drives. In this case, only a limited number of I/Os are incorrectly
acknowledged; FIO eventually receives an I/O error after the device
reference is removed.

The root cause of the problem is that dio_complete() does not
correctly propagate I/O errors in the is_async case. Specifically,
generic_write_sync() appears to be overwriting the return status
destined for ki_complete().

This bug appears to have been introduced by the following commit:

Description: "fs: simplify the generic_write_sync prototype"
Committed: Apr 7, 2016
Hash: e259221763a40403d5bb232209998e8c45804ab8
Affects: 4.7-rc1 - master

I have confirmed a fix for the AIO/Direct-IO failure condition but
have not reviewed the rest of the changes associated with that commit.
If you would like a small patch for direct-io.c, let me know.

Regards,
-Jonathan

             reply	other threads:[~2016-09-12 18:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 18:38 Jonathan Nicklin [this message]
2016-09-21 14:15 ` BUG: aio/direct-io data corruption in 4.7 Christoph Hellwig
2018-11-05 15:16 Gregory Shapiro
2018-11-06  7:28 ` Jack Wang
2018-11-06 11:31   ` Gregory Shapiro
2018-11-09 15:44     ` Jack Wang

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=CAHex0corhi5He41qdenWovgkVyD5Rpj0YLxeN+-ex4cOycqKdQ@mail.gmail.com \
    --to=jnicklin@blockbridge.com \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).