Message ID | 20180509074830.16196-9-hch@lst.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 BAC5760170 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 9 May 2018 07:49:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE5A728E05 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 9 May 2018 07:49:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A333028E2B; Wed, 9 May 2018 07:49:10 +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=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B00628E05 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 9 May 2018 07:49:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7B7DE6B0348; Wed, 9 May 2018 03:49:05 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 73E286B034A; Wed, 9 May 2018 03:49:05 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 568BF6B034B; Wed, 9 May 2018 03:49:05 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f72.google.com (mail-pl0-f72.google.com [209.85.160.72]) by kanga.kvack.org (Postfix) with ESMTP id 0DD916B0348 for <linux-mm@kvack.org>; Wed, 9 May 2018 03:49:05 -0400 (EDT) Received: by mail-pl0-f72.google.com with SMTP id x32-v6so3307756pld.16 for <linux-mm@kvack.org>; Wed, 09 May 2018 00:49:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=59Gma3LvnzN6E3pY/NVAUb2K5/ls3Qlm1HmFEvmqpZQ=; b=iAQ3XfFSP3G7mgvDnR0Lork6Pki3LNX+1i39is1/UXG2Rn4IU6yvQENdGUJrCvxlmj fhOf51oxKpVd3o7tUkx55ri7GkF+DHlHe7JssEkmdPDB8jaPvNFui+DpJhJ1dfrjS+6D uxwTj2M61tdYusuKL0/Ou7zSTNw6UWNXVdyLY7sJmiPf8Nj3l86K3bx2TG4UN/avv0Ox JznT5/Ih/f4T8wf1346mdOhCt2hnOK2wfqwa/uXitcVjou/uJF89nxrgDFJ0czs5Cr/n hvN1GjWFEsNnQ0+IPgeXU/0DOLYM7s059ht/n0FEPD9P6SMlnsx4rZYp1XXpYE4foJCr bKPQ== X-Gm-Message-State: ALQs6tDSqTyhAMaOQ2CjsnlpSYUhtjbAJ1o6u4NrnY5P1E74rREynJwN jEMhAsief+c4u8Hyo5nfdFGMZ5lRdG/WotEiYeePyQk0dNe5VoTk9AdOfAXKFg7qiJNOH/jsoLx 4WOY0YNLLObWxYilWJGLvLv95FW0Pzjepdbot8tns862dJuB9eebX7+9m43ZDKxQ= X-Received: by 10.98.152.29 with SMTP id q29mr22559363pfd.65.1525852144753; Wed, 09 May 2018 00:49:04 -0700 (PDT) X-Google-Smtp-Source: AB8JxZozcdY+tQ6NI/LsyeFZkBilOl/wVUn7rqjP3PbzgJR5qetgc5zWnN9X9B6pt+07sdHQ5T9r X-Received: by 10.98.152.29 with SMTP id q29mr22559338pfd.65.1525852144115; Wed, 09 May 2018 00:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525852144; cv=none; d=google.com; s=arc-20160816; b=KSt3AMjabgZi1Z7yGhIX3Ont7mY/mwCKMEaUPNLYRt5Zk+4U3N6YVb3ZgiHYdKOYOz 8f+0nENkN1IGbYZ5JFnMXptSNSrxvajfrKwL1wZ+W2VOgNXT7AKx8CkKci/U+JTPt3zz khdSS0e4Ga3anewMCh+xZTlOBXbPE41O2EEq1avOwOW+i8L49yz7eq/m35TWyUfbs5RS x0ZAKPXrmmHFbajLUKOoIoI25FikdOp9O3uUqnNW5kRHWodTWt/p2xbUiN+qXJcFf0xb YfUEhQCSiDiTF8KHYAluqyQIEISFuLMdj2xuNjK1l5vQG4glON3qUrsuoY8jXAv6Vgb7 obBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=59Gma3LvnzN6E3pY/NVAUb2K5/ls3Qlm1HmFEvmqpZQ=; b=m0PJjBnsUDQ/bgLCaNRNADFB2wkn9pUFZunqUtIJNQ8uSz4OhoMq30m07OGVNBzggV eaAnnpA6ulBbSOvu5nmntVXf6XPsUkfXlv2glVhJG1+1i12wn1b+A7sql+L8a/Ca2i0g TrWMIGRGU8RBCXoxEw3Zi5pAcyqWF9AcRxqdFRftL1Z5boz3faoGF/bNjA75WWR5JCG7 0UMSfD5pxzM+UC6O6+KQ5img6qDWQmct4lf2lI6Rgy5ubHRQgyd3vmkv9QRQRvf2DdYJ 8G7L64swq746EYiCbSavMLZeWJ9fitzG5lmiOA+0TeMtHxPmTa8ZBO7QWbs+WMX4uMVv qfwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=DDqozKbZ; spf=pass (google.com: best guess record for domain of batv+e0efdd19ce80d487e3da+5372+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+e0efdd19ce80d487e3da+5372+infradead.org+hch@bombadil.srs.infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id n184-v6si14617473pga.330.2018.05.09.00.49.03 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 May 2018 00:49:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of batv+e0efdd19ce80d487e3da+5372+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=DDqozKbZ; spf=pass (google.com: best guess record for domain of batv+e0efdd19ce80d487e3da+5372+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+e0efdd19ce80d487e3da+5372+infradead.org+hch@bombadil.srs.infradead.org 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=59Gma3LvnzN6E3pY/NVAUb2K5/ls3Qlm1HmFEvmqpZQ=; b=DDqozKbZgzix22rUXEEOCCiim V2rJqyHIIeyIHP26Fg1+yBA5Pf8rR3paL6sDMouSZiexHNVByDw7MOiqDNDOVFHFB5JwjUCcnmCXG NhelNaSm+bEEbvCzwSf7JBD3d5zRGR5TEPlR3XF1z8RAoKTSdszKUHre85Wfi1H+6gCYEETjKL4ED T3VG9VipbN/Fg341OrvGsQvea2iZHhoO1PU1qZXM7hi99lrr9rLoEkG9vh2/Wz3kvZC4OokoXd0ct L29z1PMlK8Wnq2MD1y33NmWWHe97/Uqxc/WkWxby+azoOoegcz1SRHMjFXYcIEazMGTI9Y1G0Iv5G T97t0NkYQ==; Received: from 213-225-15-246.nat.highway.a1.net ([213.225.15.246] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGJqR-0001R7-2r; Wed, 09 May 2018 07:49:03 +0000 From: Christoph Hellwig <hch@lst.de> To: linux-xfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 08/33] iomap: use __bio_add_page in iomap_dio_zero Date: Wed, 9 May 2018 09:48:05 +0200 Message-Id: <20180509074830.16196-9-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509074830.16196-1-hch@lst.de> References: <20180509074830.16196-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/fs/iomap.c b/fs/iomap.c index b3592183b1a0..58bb39bac72b 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -951,8 +951,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);
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 <hch@lst.de> --- fs/iomap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)