Skip to contentSkip to conversation

Btrfs: clear pages dirty for io and set them extent mapped

PATCH New Josef Bacik 1 participant 1 message Nov 15, 2011 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: clear pages dirty for io and set them extent mapped

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,

---
 fs/btrfs/free-space-cache.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
fs/btrfs/free-space-cache.c +5 -0
index 96cb54d..30e045d 100644
@@ -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;
 }
 
Signature · 1 line
1.7.5.2