From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jens Axboe <axboe@kernel.dk>, Eric Biggers <ebiggers3@gmail.com>,
Eryu Guan <guaneryu@gmail.com>,
Fengguang Wu <fengguang.wu@intel.com>,
Lukas Czerner <lczerner@redhat.com>, Jan Kara <jack@suse.cz>,
Jeff Moyer <jmoyer@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
xfs <linux-xfs@vger.kernel.org>
Subject: Re: [btrfs] WARNING: CPU: 0 PID: 6379 at fs/direct-io.c:293 dio_complete+0x1d4/0x220
Date: Mon, 13 Nov 2017 13:56:01 -0800 [thread overview]
Message-ID: <20171113215601.GD6246@magnolia> (raw)
In-Reply-To: <CA+55aFxv4jVzoa_NpYOq=+TVpBvbSmJq++dPW5nmWNdxUEc-8Q@mail.gmail.com>
[cc xfs list]
[We're discussing the WARN_ON in *dio_complete when invalidation fails]
[yes, again]
On Mon, Nov 13, 2017 at 11:21:50AM -0800, Linus Torvalds wrote:
> On Mon, Nov 13, 2017 at 11:16 AM, Jens Axboe <axboe@kernel.dk> wrote:
> >
> > I would tend to agree with you, it's annoying to dump a full stack trace
> > for an expected (even for a rare situation) condition. But it's not the
> > first one, there's also one in XFS that always triggers for test runs. I
> > complained about that one in the past.
>
> Yeah, we should always consider a WARN_ON() that is triggerable from
> user space to be a kernel bug.
>
> If it's a "cannot happen", then the bug should be fixed.
>
> If it's a "can happen, but I want to see the trace", then you just got
> the trace and you're done, and the WARN_ON() should be removed.
>
> It could possibly be replaced with a "pr_warn()" or something, so that
> it still shows up as a "the user did something dodgy", but honestly,
> even that is questionable. We do that for things like "we just removed
> support for this, we want to see if somebody is using it"
>
> So in no case is "let's just keep things as is" the right answer.
Wellll... the WARN_ON in question happens when:
a) two programs race to write to the same part of a file, one via the page
cache and the other via directio
b) the dio write completes, tries to invalidate the page cache, and fails
because the corresponding page cannot be invalidated
At this point, the page cache contents don't reflect what's on disk, so
I don't think we can quietly ignore the situation. Clearly, enough
people dislike the WARN to complain repeatedly, so perhaps we should try
to barf evidence of this situation up to userspace? The dio write
succeeded, which is why we don't turn err into ret; but now that we can
store and forward error codes through the mapping, how about we just:
errseq_set(dio->inode->i_mapping->wb_error, -EIO);
and then let the writers pick up the EIO the next time they fsync?
Though I can already imagine the complaints about writes that used to
work and suddenly start returning error codes.
--D
> Linus
next prev parent reply other threads:[~2017-11-13 21:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CA+55aFxSJGeN=2X-uX-on1Uq2Nb8+v1aiMDz5H1+tKW_N5Q+6g@mail.gmail.com>
[not found] ` <20171029225155.qcum5i75awrt5tzm@wfg-t540p.sh.intel.com>
2017-10-30 7:20 ` [btrfs] WARNING: CPU: 0 PID: 6379 at fs/direct-io.c:293 dio_complete+0x1d4/0x220 Fengguang Wu
2017-10-30 7:44 ` Eryu Guan
2017-10-31 0:10 ` Fengguang Wu
2017-10-31 6:54 ` Eryu Guan
2017-10-31 7:10 ` Fengguang Wu
2017-11-06 1:13 ` Eric Biggers
2017-11-13 19:13 ` Eric Biggers
2017-11-13 19:16 ` Jens Axboe
2017-11-13 19:21 ` Linus Torvalds
2017-11-13 21:56 ` Darrick J. Wong [this message]
2017-11-13 22:01 ` Linus Torvalds
2017-11-14 17:17 ` Theodore Ts'o
2017-10-31 15:13 ` Filipe Manana
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=20171113215601.GD6246@magnolia \
--to=darrick.wong@oracle.com \
--cc=axboe@kernel.dk \
--cc=ebiggers3@gmail.com \
--cc=fengguang.wu@intel.com \
--cc=guaneryu@gmail.com \
--cc=jack@suse.cz \
--cc=jmoyer@redhat.com \
--cc=lczerner@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=torvalds@linux-foundation.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).