From patchwork Fri Jun 21 19:28:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goldwyn Rodrigues X-Patchwork-Id: 11010673 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 817C3924 for ; Fri, 21 Jun 2019 19:28:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7208A28721 for ; Fri, 21 Jun 2019 19:28:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 662DF28B9C; Fri, 21 Jun 2019 19:28:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 216AE28721 for ; Fri, 21 Jun 2019 19:28:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726125AbfFUT2m (ORCPT ); Fri, 21 Jun 2019 15:28:42 -0400 Received: from mx2.suse.de ([195.135.220.15]:33226 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726111AbfFUT2k (ORCPT ); Fri, 21 Jun 2019 15:28:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 162A8AEE9; Fri, 21 Jun 2019 19:28:39 +0000 (UTC) From: Goldwyn Rodrigues To: linux-btrfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, hch@lst.de, darrick.wong@oracle.com, david@fromorbit.com, Goldwyn Rodrigues Subject: [PATCH 3/6] iomap: Check iblocksize before transforming page->private Date: Fri, 21 Jun 2019 14:28:25 -0500 Message-Id: <20190621192828.28900-4-rgoldwyn@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190621192828.28900-1-rgoldwyn@suse.de> References: <20190621192828.28900-1-rgoldwyn@suse.de> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Goldwyn Rodrigues btrfs uses page->private as well to store extent_buffer. Make the check stricter to make sure we are using page->private for iop by comparing iblocksize < PAGE_SIZE. Signed-off-by: Goldwyn Rodrigues --- include/linux/iomap.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/iomap.h b/include/linux/iomap.h index f49767c7fd83..6511124e58b6 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -128,7 +128,8 @@ struct iomap_page { static inline struct iomap_page *to_iomap_page(struct page *page) { - if (page_has_private(page)) + if (i_blocksize(page->mapping->host) < PAGE_SIZE && + page_has_private(page)) return (struct iomap_page *)page_private(page); return NULL; }