xfs-masters
[Top] [All Lists]

[Bug 874] non-default extsize values introduces garbage into holey files

To: xfs-masters@xxxxxxxxxxx
Subject: [Bug 874] non-default extsize values introduces garbage into holey files
From: bugzilla-daemon@xxxxxxxxxxx
Date: Fri, 25 May 2012 12:52:02 -0500
Auto-submitted: auto-generated
In-reply-to: <bug-874-113@xxxxxxxxxxxxxxxx/bugzilla/>
References: <bug-874-113@xxxxxxxxxxxxxxxx/bugzilla/>
http://oss.sgi.com/bugzilla/show_bug.cgi?id=874


Mark Tinguely <tinguely@xxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |tinguely@xxxxxxx
         Resolution|                            |FIXED




--- Comment #3 from Mark Tinguely <tinguely@xxxxxxx>  2012-05-25 12:52:00 CST 
---
This can be closed.

Fixed by commit:

commit aff3a9edb7080f69f07fe76a8bd089b3dfa4cb5d
Author: Dave Chinner <dchinner@xxxxxxxxxx>
Date:   Mon Apr 23 15:58:44 2012 +1000

    xfs: Use preallocation for inodes with extsz hints

    xfstest 229 exposes a problem with buffered IO, delayed allocation
    and extent size hints. That is when we do delayed allocation during
    buffered IO, we reserve space for the extent size hint alignment and
    allocate the physical space to align the extent, but we do not zero
    the regions of the extent that aren't written by the write(2)
    syscall. The result is that we expose stale data in unwritten
    regions of the extent size hints.

    There are two ways to fix this. The first is to detect that we are
    doing unaligned writes, check if there is already a mapping or data
    over the extent size hint range, and if not zero the page cache
    first before then doing the real write. This can be very expensive
    for large extent size hints, especially if the subsequent writes
    fill then entire extent size before the data is written to disk.

    The second, and simpler way, is simply to turn off delayed
    allocation when the extent size hint is set and use preallocation
    instead. This results in unwritten extents being laid down on disk
    and so only the written portions will be converted. This matches the
    behaviour for direct IO, and will also work for the real time
    device. The disadvantage of this approach is that for small extent
    size hints we can get file fragmentation, but in general extent size
    hints are fairly large (e.g. stripe width sized) so this isn't a big
    deal.

    Implement the second approach as it is simple and effective.

    Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
    Reviewed-by: Mark Tinguely <tinguely@xxxxxxx>
    Signed-off-by: Ben Myers <bpm@xxxxxxx>

-- 
Configure bugmail: http://oss.sgi.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

<Prev in Thread] Current Thread [Next in Thread>
  • [Bug 874] non-default extsize values introduces garbage into holey files, bugzilla-daemon <=