From patchwork Wed May 23 14:43:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10421543 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 DE2736032A for ; Wed, 23 May 2018 14:44:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD5F9287B4 for ; Wed, 23 May 2018 14:44:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C19EA28865; Wed, 23 May 2018 14:44:58 +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 71653287B4 for ; Wed, 23 May 2018 14:44:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 73B5A6B026F; Wed, 23 May 2018 10:44:40 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6C3FB6B0270; Wed, 23 May 2018 10:44:40 -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 544636B0271; Wed, 23 May 2018 10:44:40 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f200.google.com (mail-pf0-f200.google.com [209.85.192.200]) by kanga.kvack.org (Postfix) with ESMTP id 00E366B026F for ; Wed, 23 May 2018 10:44:40 -0400 (EDT) Received: by mail-pf0-f200.google.com with SMTP id c187-v6so13275810pfa.20 for ; Wed, 23 May 2018 07:44:39 -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=KgwG3h7JpT+wBoJXh7QKSbKMml6ppisM6X3NqRpFS84=; b=QWrAGn6vzHnkhrSqlRxCK+sLOEXX43H+NMCWCMZI4X7a1R8H0os2bPylhQ+vC+1SEq L4BG02gB710gPDeyoKEPEOg0EUWPZ6HUmKH3AoKDjirc0Q8epC+Zh8eAJSmZrl3FlOau ulxE+botIo/0r0IWBxJIakXROD5/XEwbbQsnroJM01aKeKKy6kPntFpC37whBBsZLhop GEwuZSwGJer+xC+0p/I8Sy/2yQLTd5whLLlzMlVe8ke8mqTPG+BGaRzEHFWOgWwSKG7A 5jxyXGPkss3Xt5bpRVjkUVyxAfQ8RaiR3MSnLkQoEQbJ4zcOD66Efo81MMJ88nWhpiBf 2QJA== X-Gm-Message-State: ALKqPwfqWHwVFYaUGgzrgG+27SMend6q3A2rMllbtCX6GIKhsF1E8RFL QQz0kyMRY0y+nBXr0ZitlC5W2hgFY0CEel1x3h6dGq+dYpIpCUNNrUaQgAt6GRbG2xz2jRMWw/x 4fq9vkPGw4ZrHEOGbQ7JaXbjUH1Ki9rcb1dQqG3TSZbTNRRXxElcPncxLfDnumt8= X-Received: by 2002:a62:7682:: with SMTP id r124-v6mr3202470pfc.80.1527086679705; Wed, 23 May 2018 07:44:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrweMRH551DN9JOKA+gO/26X+tIvTgahhJEZvxpV3E+0Myiwotmj+KhPS1a9g9clHKyX0az X-Received: by 2002:a62:7682:: with SMTP id r124-v6mr3202432pfc.80.1527086678995; Wed, 23 May 2018 07:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527086678; cv=none; d=google.com; s=arc-20160816; b=kb4UCq402bV21BPFAJIWaza8Mtpn0AkvmNvDyikh4er9RXcP6yOb6JHWfnIxLh9r9z R5kzH6DPaYhYVQs1dNJ1TfDgXol2wVTyXSFrivr21khRVUTCwA6wrQgaBIbcFFJAElAq iUZYZSvnC30tzTiYwnD499Jp1btKt7CCsQcG4UV2V48Kb11mOGM7J2qPNJ8IyR+oNtkH jWnYQehomj0dqG1D+cqRLARdT2hc8TMLTKFxmRZ+im2S0oUxb3AMGMGnnYqhghR6K0gR WtMbX/9j5CrMhTLEaltgzaugQYBcF+pA/meQF4ORFupCzuWXZq21vrbv6Lwh0PfI2I0u ZwoA== 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=KgwG3h7JpT+wBoJXh7QKSbKMml6ppisM6X3NqRpFS84=; b=iftPttzEianDnQCvZ8xsMrExpxMMpivEYgZkROsw+mlqmIzz9BsGGV89Is/sU2IRCf Rb9zRFlH9lIbW/C4WMRJtxrLFs0iNASiSkwpToPIItPJz0JHcwjmM+T43i1qOU4XNeWT q6fXLHsaLFGYuU7RhzRE78uZHakwhA4hiYDFA3c3vErtTb2hQ6vRvBg0ofcZd8f1HEaK A7XxKdJ5DijYMO/tGfl83PzJwEQfKuHRlNlsHQsjuvArWqAGHVF/ERykD656iV/zKSAB wbNaN7tu+1z5YNNXG45OQddoZqhY2MDDMXZV+d5iVhArcWMIXfLXoDOKekw/T1EbjgX6 DeGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=dLISZbHg; spf=pass (google.com: best guess record for domain of batv+df5a2477ff0fa86e9985+5386+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+df5a2477ff0fa86e9985+5386+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 d12-v6si19415599plo.551.2018.05.23.07.44.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 May 2018 07:44:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of batv+df5a2477ff0fa86e9985+5386+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=dLISZbHg; spf=pass (google.com: best guess record for domain of batv+df5a2477ff0fa86e9985+5386+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+df5a2477ff0fa86e9985+5386+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=KgwG3h7JpT+wBoJXh7QKSbKMml6ppisM6X3NqRpFS84=; b=dLISZbHgWOzjdgSYZysIV+IqD JocKslFFJpTYsu2CRHgRhIxlflnQyllj/LdshqWIX4yCzMAbJ+tOzINByVp731yIyOGsnenL8Imbx J2GhCZ73aiRvNi65diYnHeRRGC3kCUIIUSV8H1/3te+XwyNZEP6DBpUlDCswwxeIP2hHV6M/7aTmL XKzheeWqeEX6c4fN2cSaVwzL1KO8htvyl3+ZD5HVqxT3mv7B7Vu8czADTLGNNNyidjXwUoEQ/WhCu lC8lMKNNaW63UQ6Jdzvlb20qnc1CrLgw4zAaCMlwPbPKLSq8iYc+PjKXPzJKtx5qj5YS6tXIm6mt7 QoLF6BWuA==; Received: from 089144199016.atnat0008.highway.a1.net ([89.144.199.16] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLV0H-0000Mr-G7; Wed, 23 May 2018 14:44:37 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 12/34] iomap: use __bio_add_page in iomap_dio_zero Date: Wed, 23 May 2018 16:43:35 +0200 Message-Id: <20180523144357.18985-13-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180523144357.18985-1-hch@lst.de> References: <20180523144357.18985-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from 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: 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: 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 f52209a2c270..8e28f25f086f 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -949,8 +949,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);