diff mbox series

[v4,64/68] btrfs: inode: always mark the full page range delalloc for btrfs_page_mkwrite()

Message ID 20201021062554.68132-65-wqu@suse.com
State New, archived
Headers show
Series btrfs: add basic rw support for subpage sector size | expand

Commit Message

Qu Wenruo Oct. 21, 2020, 6:25 a.m. UTC
So that we won't get subpage sized EXTENT_DELALLOC, which could easily
screwup the PAGE aligned write space reservation for subpage support.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/inode.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index f3bc894611e0..0da6c91db0bc 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -8323,8 +8323,7 @@  vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf)
 	}
 
 	if (page->index == ((size - 1) >> PAGE_SHIFT)) {
-		reserved_space = round_up(size - page_start,
-					  fs_info->sectorsize);
+		reserved_space = round_up(size - page_start, PAGE_SIZE);
 		if (reserved_space < PAGE_SIZE) {
 			end = page_start + reserved_space - 1;
 			btrfs_delalloc_release_space(BTRFS_I(inode),