From patchwork Fri May 18 16:48:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10411269 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 D8AA8601F9 for ; Fri, 18 May 2018 16:49:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8CF528619 for ; Fri, 18 May 2018 16:49:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC357288BD; Fri, 18 May 2018 16:49:18 +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=ham 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 58B9B28619 for ; Fri, 18 May 2018 16:49:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9569C6B060F; Fri, 18 May 2018 12:49:10 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8DBF86B0611; Fri, 18 May 2018 12:49:10 -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 77D326B0610; Fri, 18 May 2018 12:49:10 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f70.google.com (mail-pg0-f70.google.com [74.125.83.70]) by kanga.kvack.org (Postfix) with ESMTP id 307D06B060E for ; Fri, 18 May 2018 12:49:10 -0400 (EDT) Received: by mail-pg0-f70.google.com with SMTP id z16-v6so3081221pge.21 for ; Fri, 18 May 2018 09:49:10 -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=Yu9O4wqf19CqLNfN4ohqvmJ4bJ7J1od2q1Mvyws2sOg=; b=tcw09mFTDxvoB60p+7Dbi3FY0/46SUBRPEgsd3jEkh/Dd/Onh09F5jY1o/o+ce8Ybq tSo7fns/ibw6ChOtPuKttfphFaqAfuT/U/3dKCar2b0qcDvdmKJUXu9TDeEWn45vzQPJ Rf34UCqTy9LLuSbmV2SdEcKEaxiPr02BqkK1ZnKpDcB3fCGsEeS9Gb3W2LhQHbw9367O Oc3gnJUNjeHPnxBnZMergmKQ6OSBduLvjboi4DEjFxz3aUKhFEYaumssbhPSEmGd8XPD g45JJiorU04hkdmNQ04j4ZECsTCgSJyoFHoGbeou9Ae4WmlAhlpnPIRk1Y3QRTLvAvQT bKvQ== X-Gm-Message-State: ALKqPwfFNNZNJ3dYdmpsuQtE+KvQNGj+cr5tZOrxcrQDt/0WCi/5q5Fi xfoydkI2PnN9kNUlW8W996BEjVM6Rg+W2kTLhMqZTZh4ybooP1adpibG4n9/w4/Lpxhnjv2Op9g CgL4DONk9da6712YpU9zn9b8i0IgvaD7leXM+WhopXGDGXcenOjaep2jGDmM99yc= X-Received: by 2002:a17:902:a711:: with SMTP id w17-v6mr10285994plq.292.1526662149912; Fri, 18 May 2018 09:49:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrEuxSQE1ZXJmH4Zk2iplrq0AQuR9VL2UX7kEKh5ZJDaqEImrWWGrhtbqcSQMlurn9Bf1SC X-Received: by 2002:a17:902:a711:: with SMTP id w17-v6mr10285956plq.292.1526662149377; Fri, 18 May 2018 09:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526662149; cv=none; d=google.com; s=arc-20160816; b=JA1XdpXhDDP9927Hk7KUNNLO0rUvP4hQcjwOF1W3wDsPhWepHRm0qwGM9GLWdf1rDT +6dT9ALsCBegRiPiu7OZVczOgY43ovcj+h+F3bz4cd8rztLWHIFiU947JQ4fH+5wl5x0 QQWKEaMlZYRECvkUByNHLxkUYbg6sULVqN6+jQVqsW71uzcAsXp4oNSlBdo4DnZv7Zxy tB0dKURxCeMTqtVXd38tvwEvzC8covhrW0mP3SaROWDWtb6AKUK3KwNsXuIITcXI8qBz 0IDz68Tb7DtjJeCUkWJaNoCXl0rNIxkxikmtk+yX3smLCSIYamwbDHeH3QmzNFSDwGM9 UaNw== 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=Yu9O4wqf19CqLNfN4ohqvmJ4bJ7J1od2q1Mvyws2sOg=; b=emunKcS8wq0JbAQfvjOvd+MV/tJFqoZiQkY3ZRfCfvPtbN9I3GF9wMf5Z3vLNAKkqo UPJDdxNiH8CdlBHllfOaok+q+dZccM+rnbYzQIXHzdeLO3niqDKi6FSCY54moM5d7UeP zaXoVjj62ZatauhhF9NuEdJpcLNTE97ACr0ivngXszVgIeHdOKQIwG5/seRbm1qjAtPL DXketr4ra0wL/JM95dO1ij08LIoizJ4iF0m/jOS1R4CyFaCl2fVX9csMuYbADnVuNc6U 2FldISNZciPFuYd7VeZR+NPhm++aD8XEQp6W0wj19Q7Ky2+KBCWPzPWffvGJsU1PZvfu 0HgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=dnmdumdw; spf=pass (google.com: best guess record for domain of batv+77ddf8e9b1b344f28472+5381+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+77ddf8e9b1b344f28472+5381+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 o1-v6si7269616plk.577.2018.05.18.09.49.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 May 2018 09:49:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of batv+77ddf8e9b1b344f28472+5381+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=dnmdumdw; spf=pass (google.com: best guess record for domain of batv+77ddf8e9b1b344f28472+5381+infradead.org+hch@bombadil.srs.infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=BATV+77ddf8e9b1b344f28472+5381+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=Yu9O4wqf19CqLNfN4ohqvmJ4bJ7J1od2q1Mvyws2sOg=; b=dnmdumdwn25ufAhzOwe9dDoFa RxFjVQ8GW8siYXyiDX9Ryu3Db/q88z/yj8dEwz9x8CQ9V/fpheODAbWgmd5B1k/H94h3hw3ckD2yP KR17N/vGgTcX6UQ9pmePFIAiwkjiaJEhhKAqoVKSUSnN3Ta9dpXx6kYelJu4wJHBAb+j83vzj37+0 uvIVVtOjs7jRTJutJCYmwYE4/dnvtjkFyjUCOm8zuq4kSYXR2s1/XNOkNprCYohL2OBlLTjRnZhwU Oq9s+byg0+7x06YvKkB/jqhJyZRF+fVoqYr5xgH71+VmJ4gxnCAiOpwplQcIVhyFR47Qoz/TRxR+u M0Mf+mQnQ==; Received: from 80-109-164-210.cable.dynamic.surfer.at ([80.109.164.210] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJiZ2-0006Xs-HU; Fri, 18 May 2018 16:49:08 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 12/34] iomap: use __bio_add_page in iomap_dio_zero Date: Fri, 18 May 2018 18:48:08 +0200 Message-Id: <20180518164830.1552-13-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518164830.1552-1-hch@lst.de> References: <20180518164830.1552-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 --- fs/iomap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/iomap.c b/fs/iomap.c index a859e15d7bec..6427627a247f 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -957,8 +957,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);