diff mbox

[4/7] btrfs: subpagesize-blocksize: Handle iosize properly in submit_extent_page()

Message ID 1386805122-23972-5-git-send-email-sekharan@us.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chandra Seetharaman Dec. 11, 2013, 11:38 p.m. UTC
For the subpagesize-blocksize case make sure that the IO submitted through
submit_extent_page() is at least of PAGE_CACHE_SIZE

Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
---
 fs/btrfs/extent_io.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index e1992ed..2cf2a3b 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2647,6 +2647,9 @@  static int submit_extent_page(int rw, struct extent_io_tree *tree,
 	int old_compressed = prev_bio_flags & EXTENT_BIO_COMPRESSED;
 	size_t page_size = min_t(size_t, size, PAGE_CACHE_SIZE);
 
+	if (page->mapping->host->i_sb->s_blocksize < PAGE_CACHE_SIZE)
+		page_size = PAGE_CACHE_SIZE;
+
 	if (bio_ret && *bio_ret) {
 		bio = *bio_ret;
 		if (old_compressed)