]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Btrfs: clear pages dirty for io and set them extent mapped
authorJosef Bacik <josef@redhat.com>
Tue, 15 Nov 2011 14:31:24 +0000 (09:31 -0500)
committerChris Mason <chris.mason@oracle.com>
Fri, 16 Dec 2011 19:39:46 +0000 (14:39 -0500)
When doing the io_ctl helpers to clean up the free space cache stuff I stopped
using our normal prepare_pages stuff, which means I of course forgot to do
things like set the pages extent mapped, which will cause us all sorts of
wonderful propblems.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
(cherry picked from commit f7d61dcd6873c49bcc42be2caa2af1c2511aa915)

fs/btrfs/free-space-cache.c

index 8c32434da2cbbba1c07087092aeac50f9d427f2b..aedacdbf77e2345acff1127dc903fcdfe29abb47 100644 (file)
@@ -351,6 +351,11 @@ static int io_ctl_prepare_pages(struct io_ctl *io_ctl, struct inode *inode,
                }
        }
 
+       for (i = 0; i < io_ctl->num_pages; i++) {
+               clear_page_dirty_for_io(io_ctl->pages[i]);
+               set_page_extent_mapped(io_ctl->pages[i]);
+       }
+
        return 0;
 }