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>
Sun, 20 Nov 2011 12:42:17 +0000 (07:42 -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>
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;
 }