From patchwork Thu May 31 18:06:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10441679 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E2DE1602BC for ; Thu, 31 May 2018 18:06:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFE0728F25 for ; Thu, 31 May 2018 18:06:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4BAA28F91; Thu, 31 May 2018 18:06:48 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 78EAE28FA7 for ; Thu, 31 May 2018 18:06:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755985AbeEaSGr (ORCPT ); Thu, 31 May 2018 14:06:47 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:50368 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755982AbeEaSGp (ORCPT ); Thu, 31 May 2018 14:06:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=NcqDkZVy+WeZbgl3NGgohbOk1ZGlRx3vUsAh2lpGXLA=; b=GjF8p2WDKeqGC/pJzDOeO2Jn4 eYzVwpJ6/5K/qEYgU0niu5ehT0Yuw8ANcdbbuvB1fr3mqZ30KhF2xbsJT+fZ+Gp9NYiMlg+KWIsLh GxhISkiOhy8fvvcnpFhzzoPBo2UC+rHJBJgr4FuumfIhqihwXuts6dOQMfVxq4ZhvjobkKRZM3Awb 5Lj/0pNkTbOBrMHDhoSjofO9PanVr1zJDP6EgdMWsXOW2oFr3PgwpoOg9uciK1fm1Bwtjd0GzFNYV V7B8BEOXrIcsY7mPsr3UOlN7D9YTW+h0BTdlinPF4MAAliOqhbCskTM1LQr+ekN0NZRiKM8Ur3WB3 wAkslT7wg==; Received: from 213-225-38-123.nat.highway.a1.net ([213.225.38.123] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fORyG-0003Ou-Me; Thu, 31 May 2018 18:06:45 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 08/13] iomap: use __bio_add_page in iomap_dio_zero Date: Thu, 31 May 2018 20:06:09 +0200 Message-Id: <20180531180614.21506-9-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180531180614.21506-1-hch@lst.de> References: <20180531180614.21506-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't need any merging logic, and this also replaces a BUG_ON with a WARN_ON_ONCE inside __bio_add_page for the impossible overflow condition. Signed-off-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong --- fs/iomap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/iomap.c b/fs/iomap.c index df2652b0d85d..85901b449146 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -845,8 +845,7 @@ iomap_dio_zero(struct iomap_dio *dio, struct iomap *iomap, loff_t pos, bio->bi_end_io = iomap_dio_bio_end_io; get_page(page); - if (bio_add_page(bio, page, len, 0) != len) - BUG(); + __bio_add_page(bio, page, len, 0); bio_set_op_attrs(bio, REQ_OP_WRITE, REQ_SYNC | REQ_IDLE); atomic_inc(&dio->ref);