Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=effd120edb7609069cca9f3d1cb4bfae464b2f85
Commit:     effd120edb7609069cca9f3d1cb4bfae464b2f85
Parent:     45c34141126a89da07197d5b89c04c6847f1171a
Author:     David Chinner <[EMAIL PROTECTED]>
AuthorDate: Mon Jun 18 16:49:58 2007 +1000
Committer:  Tim Shimmin <[EMAIL PROTECTED]>
CommitDate: Sat Jul 14 15:32:49 2007 +1000

    [XFS] Map unwritten extents correctly for I/o completion processing
    
    If we have multiple unwritten extents within a single page, we fail to
    tell the I/o completion construction handlers we need a new handle for the
    second and subsequent blocks in the page. While we still issue the I/O
    correctly, we do not have the correct ranges recorded in the ioend
    structures and hence when we go to convert the unwritten extents we screw
    it up.
    
    Make sure we start a new ioend every time the mapping changes so that we
    convert the correct ranges on I/O completion.
    
    SGI-PV: 964647
    SGI-Modid: xfs-linux-melb:xfs-kern:28797a
    
    Signed-off-by: David Chinner <[EMAIL PROTECTED]>
    Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]>
    Signed-off-by: Tim Shimmin <[EMAIL PROTECTED]>
---
 fs/xfs/linux-2.6/xfs_aops.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index c097e4e..fd4105d 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -1010,6 +1010,8 @@ xfs_page_state_convert(
                if (buffer_unwritten(bh) || buffer_delay(bh) ||
                    ((buffer_uptodate(bh) || PageUptodate(page)) &&
                     !buffer_mapped(bh) && (unmapped || startio))) {
+                       int new_ioend = 0;
+
                        /*
                         * Make sure we don't use a read-only iomap
                         */
@@ -1028,6 +1030,15 @@ xfs_page_state_convert(
                        }
 
                        if (!iomap_valid) {
+                               /*
+                                * if we didn't have a valid mapping then we
+                                * need to ensure that we put the new mapping
+                                * in a new ioend structure. This needs to be
+                                * done to ensure that the ioends correctly
+                                * reflect the block mappings at io completion
+                                * for unwritten extent conversion.
+                                */
+                               new_ioend = 1;
                                if (type == IOMAP_NEW) {
                                        size = xfs_probe_cluster(inode,
                                                        page, bh, head, 0);
@@ -1047,7 +1058,7 @@ xfs_page_state_convert(
                                if (startio) {
                                        xfs_add_to_ioend(inode, bh, offset,
                                                        type, &ioend,
-                                                       !iomap_valid);
+                                                       new_ioend);
                                } else {
                                        set_buffer_dirty(bh);
                                        unlock_buffer(bh);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to