xfs
[Top] [All Lists]

Re: [PATCH v2 5/5] dax: handle media errors in dax_do_io

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH v2 5/5] dax: handle media errors in dax_do_io
From: Dan Williams <dan.j.williams@xxxxxxxxx>
Date: Mon, 25 Apr 2016 16:43:14 -0700
Cc: "Verma, Vishal L" <vishal.l.verma@xxxxxxxxx>, "linux-block@xxxxxxxxxxxxxxx" <linux-block@xxxxxxxxxxxxxxx>, "jack@xxxxxxx" <jack@xxxxxxx>, "axboe@xxxxxx" <axboe@xxxxxx>, "linux-nvdimm@xxxxxxxxxxx" <linux-nvdimm@xxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>, "hch@xxxxxxxxxxxxx" <hch@xxxxxxxxxxxxx>, "linux-mm@xxxxxxxxx" <linux-mm@xxxxxxxxx>, "Wilcox, Matthew R" <matthew.r.wilcox@xxxxxxxxx>, "linux-fsdevel@xxxxxxxxxxxxxxx" <linux-fsdevel@xxxxxxxxxxxxxxx>, "akpm@xxxxxxxxxxxxxxxxxxxx" <akpm@xxxxxxxxxxxxxxxxxxxx>, "linux-ext4@xxxxxxxxxxxxxxx" <linux-ext4@xxxxxxxxxxxxxxx>, "viro@xxxxxxxxxxxxxxxxxx" <viro@xxxxxxxxxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=fM037LjD1MJIaVncOPQycbJTPt1rQZ3UlVj/vpbwc+E=; b=dQbntW6tFLZQZOhgBVhq7orpjTq+0YT5PfgDt88N9DN/Bd2jnQk4c2mz7GYw227bF8 25eLg2REPP0FrnjZFil+O67gerPpVWJS+f89AuOMKBhTcuotY5g4j0dFUVAIKNfhTfHK aMBWcE/bwgYr/yAOR74OxLOAUXHFV/e9FjDm1986/MJJbgSxKiYhiatpTaBjPNwYTG6/ xbvtYBeuzVaJNZTk9TAWpU9oBeVCnNuqwCmXFIYDWWUZiZmOyZzX2NkxD6FitAJhbpVY ob0rC0XJ+QqvnFEWECd3hEw4hngvhuj+AmBP3dDg0JcJh61Duxtxf1NmFJ16c2wdf3SA Gkow==
In-reply-to: <20160425232552.GD18496@dastard>
References: <1459303190-20072-1-git-send-email-vishal.l.verma@xxxxxxxxx> <1459303190-20072-6-git-send-email-vishal.l.verma@xxxxxxxxx> <x49twj26edj.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20160420205923.GA24797@xxxxxxxxxxxxx> <1461434916.3695.7.camel@xxxxxxxxx> <20160425083114.GA27556@xxxxxxxxxxxxx> <1461604476.3106.12.camel@xxxxxxxxx> <20160425232552.GD18496@dastard>
On Mon, Apr 25, 2016 at 4:25 PM, Dave Chinner <david@xxxxxxxxxxxxx> wrote:
> On Mon, Apr 25, 2016 at 05:14:36PM +0000, Verma, Vishal L wrote:
>> On Mon, 2016-04-25 at 01:31 -0700, hch@xxxxxxxxxxxxx wrote:
>> > On Sat, Apr 23, 2016 at 06:08:37PM +0000, Verma, Vishal L wrote:
>> > >
>> > > direct_IO might fail with -EINVAL due to misalignment, or -ENOMEM
>> > > due
>> > > to some allocation failing, and I thought we should return the
>> > > original
>> > > -EIO in such cases so that the application doesn't lose the
>> > > information
>> > > that the bad block is actually causing the error.
>> > EINVAL is a concern here.  Not due to the right error reported, but
>> > because it means your current scheme is fundamentally broken - we
>> > need to support I/O at any alignment for DAX I/O, and not fail due to
>> > alignbment concernes for a highly specific degraded case.
>> >
>> > I think this whole series need to go back to the drawing board as I
>> > don't think it can actually rely on using direct I/O as the EIO
>> > fallback.
>> >
>> Agreed that DAX I/O can happen with any size/alignment, but how else do
>> we send an IO through the driver without alignment restrictions? Also,
>> the granularity at which we store badblocks is 512B sectors, so it
>> seems natural that to clear such a sector, you'd expect to send a write
>> to the whole sector.
>>
>> The expected usage flow is:
>>
>> - Application hits EIO doing dax_IO or load/store io
>>
>> - It checks badblocks and discovers it's files have lost data
>
> Lots of hand-waving here. How does the application map a bad
> "sector" to a file without scanning the entire filesystem to find
> the owner of the bad sector?
>
>> - It write()s those sectors (possibly converted to file offsets using
>> fiemap)
>>     * This triggers the fallback path, but if the application is doing
>> this level of recovery, it will know the sector is bad, and write the
>> entire sector
>
> Where does the application find the data that was lost to be able to
> rewrite it?
>
>> - Or it replaces the entire file from backup also using write() (not
>> mmap+stores)
>>     * This just frees the fs block, and the next time the block is
>> reallocated by the fs, it will likely be zeroed first, and that will be
>> done through the driver and will clear errors
>
> There's an implicit assumption that applications will keep redundant
> copies of their data at the /application layer/ and be able to
> automatically repair it? And then there's the implicit assumption
> that it will unlink and free the entire file before writing a new
> copy, and that then assumes the the filesystem will zero blocks if
> they get reused to clear errors on that LBA sector mapping before
> they are accessible again to userspace..
>
> It seems to me that there are a number of assumptions being made
> across multiple layers here. Maybe I've missed something - can you
> point me to the design/architecture description so I can see how
> "app does data recovery itself" dance is supposed to work?
>

Maybe I missed something, but all these assumptions are already
present for typical block devices, i.e. sectors may go bad and a write
may make the sector usable again.  This patch series is extending that
out to the DAX-mmap case, but it's the same principle of "write to
clear error" that we live with in the block-I/O path.  What
clarification are you looking for beyond that point?

<Prev in Thread] Current Thread [Next in Thread>