From patchwork Wed Dec 11 23:38:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandra Seetharaman X-Patchwork-Id: 3329031 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9145B9F37C for ; Wed, 11 Dec 2013 23:41:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9968C207CA for ; Wed, 11 Dec 2013 23:41:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D84132068F for ; Wed, 11 Dec 2013 23:40:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751863Ab3LKXk4 (ORCPT ); Wed, 11 Dec 2013 18:40:56 -0500 Received: from e38.co.us.ibm.com ([32.97.110.159]:37187 "EHLO e38.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751806Ab3LKXk4 (ORCPT ); Wed, 11 Dec 2013 18:40:56 -0500 Received: from /spool/local by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 11 Dec 2013 16:40:55 -0700 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 11 Dec 2013 16:40:54 -0700 Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 6234719D803E for ; Wed, 11 Dec 2013 16:40:47 -0700 (MST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp07028.gho.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rBBLcj7Y5571046 for ; Wed, 11 Dec 2013 22:38:45 +0100 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rBBNerre031452 for ; Wed, 11 Dec 2013 16:40:53 -0700 Received: from localfs-p1-lp01.austin.ibm.com (localfs-p1-lp01.austin.ibm.com [9.3.192.137]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id rBBNedZ5029578; Wed, 11 Dec 2013 16:40:53 -0700 From: Chandra Seetharaman To: linux-btrfs@vger.kernel.org Cc: Chandra Seetharaman Subject: [PATCH 4/7] btrfs: subpagesize-blocksize: Handle iosize properly in submit_extent_page() Date: Wed, 11 Dec 2013 17:38:39 -0600 Message-Id: <1386805122-23972-5-git-send-email-sekharan@us.ibm.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1386805122-23972-1-git-send-email-sekharan@us.ibm.com> References: <1386805122-23972-1-git-send-email-sekharan@us.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13121123-1344-0000-0000-00000409BD35 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- fs/btrfs/extent_io.c | 3 +++ 1 file changed, 3 insertions(+) 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)