From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:49146 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850AbdF3LJR (ORCPT ); Fri, 30 Jun 2017 07:09:17 -0400 Date: Fri, 30 Jun 2017 13:09:13 +0200 From: Carlos Maiolino Subject: Re: [PATCH 0/2 V4] Resubmit items failed during writeback Message-ID: <20170630110913.g43b6ro5tvf3wqho@eorzea.usersys.redhat.com> References: <20170619135120.GD25516@bfoster.bfoster> <20170619174203.GA4733@birch.djwong.org> <20170619185111.GA29903@bfoster.bfoster> <20170621004550.GF4733@birch.djwong.org> <20170621101526.GC28914@bfoster.bfoster> <20170621110349.xhucfxyratu4qmym@eorzea.usersys.redhat.com> <20170621115132.GE28914@bfoster.bfoster> <20170621165416.GI4733@birch.djwong.org> <20170622120528.ala3ofmjvrdxx7ye@eorzea.usersys.redhat.com> <20170622124047.GA34265@bfoster.bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170622124047.GA34265@bfoster.bfoster> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Brian Foster Cc: "Darrick J. Wong" , linux-xfs@vger.kernel.org Hey, > Taking a quick look at something I have laying around that you sent > previously (I assume the test hasn't changed much), I see we basically > create an overprovisioned dm-thin vol, mount it and dio write to it > until we start to see async write failures. So is the purpose of the > wait that we need the AIL to push and ultimately fail the associated > buffers before we attempt an unmount? If so, I'm wondering if you could > xfs_freeze the fs rather than wait (it looks like freeze sync pushes the > AIL)..? > As we discussed off-list, yes, I'd done some testing, and I believe we can use freezing to test it. > > > > > > > > I think we all agree that generic error injection (which Darrick has > > > > started playing with, but I haven't looked at yet) doesn't need to be > > > > bundled with this series (I hope we didn't scare you there ;). What I > > > > was asking for is a single patch that adds error injection in one spot > > > > with a configurable frequency. I'll refer to commit 609adfc2ed ("xfs: > > > > debug mode log record crc error injection") again because it is a simple > > > > example of a small DEBUG only hunk of code and boilerplate code to add a > > > > sysfs knob. > > > > > > > > I'll keep this in mind, and try to work on something like that :) > > > > I think error injection would make this test more straightforward > because you can explicitly control when I/Os fail and there's no need to > play around with dm-thin. That of course doesn't mean there isn't value > in having a test for fs' in dm-thin out of space conditions in general. > :) Well, this is doable, although it has a caveat. To do this, we'd need to inject the error in the buffer during IO completion, for example in xfs_buf_ioend(). The problem though, is that we start to have IOs before the 'mp->m_errotag' is actually initialized, so, xfs_buf_ioend() would need to check for m_errortag initialization before calling XFS_TEST_ERROR(). Something like this: bp->b_flags &= ~(XBF_READ | XBF_WRITE | XBF_READ_AHEAD); + if (bp->b_target->bt_mount->m_errortag) { + if (XFS_TEST_ERROR(false, bp->b_target->bt_mount, + XFS_ERRTAG_BUF_WB)) { + bp->b_io_error = -ENOSPC; + } + } This check could also be done in xfs_errortag_test(), although I'm not sure if it's worth, giving that there are very few places where error injection can be useful and m_errortag can be uninitialized. Thoughts? -- Carlos