Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1391896pxj; Fri, 21 May 2021 13:06:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPqdrWYTLsFCNHQjCcIWEJQYglOlR+D3g/sD0BUlbAuzXUGV8S5xNSHcyC+YaaJIjM1E/R X-Received: by 2002:a6b:b555:: with SMTP id e82mr578254iof.202.1621627589807; Fri, 21 May 2021 13:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621627589; cv=none; d=google.com; s=arc-20160816; b=dbD2CZRpbs5bIn9Ul1A/QDu7YkrBLG4P3cYsEuXYACTM3u9nCRfOThLtv+SAO9hQiT k+pQ9nNYpbWzwjKgJdqfrqTuA7ywAyi/R42NXeHgjU5B/dbrZrR28Sg/yoEgYWcHm/Jv YCqc9E4grs3ZcApI12aU4sz0UE32H3gDXJ2GIRjf4Cok/F3Z/as+F1nXHxvhmVIqENki v0XQm9x1uRDKLsWJo3HdCwYYn8+4rqCF8arq8dDKZpiP6BexTpPHU70CN1gYmWmS/8+J k2VrvkHSvUqTkqratVWXKAumXiNhsA/sz7CZlKg3TMMgb40Cwrl0KVLMAhixWFKq3i5n NyLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=sofK4ULkenKC/+/f/DT8z29sRFXqcwinw37YO/40m/M=; b=u0Kn+fBmA5KnAYvcnK8aBSj2HXn1aFfRhNR511/IaKjdnPKMNT9+RigdL5gk2HdUoa Lx+bwD+MZSq5CL4RYvjhWYKU6/wOtJPuSbOT0w9gVLs9QH5bmsK0pyI8zyfKZrkh8LLQ dTzNvw+bQ26Ee6+fcuMBmM87FXn8DHHSqX2CNpbtAAPrEemOVyH1RCdnemKqXnS6mvat 0NnMPQOuzV1mIgTNq6z7PLy5+52Pn+I18/J2EMOkmtCsixOqGGHU3ZOH5SUGYHOoSXEV pL3kTbWUf3djP7hia+ZaHViN10KYF4cHV27RkgnQJBu3audTLaVG8Xk2cp7EPGM9HPHH Bm2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g10si7132662ilf.140.2021.05.21.13.06.17; Fri, 21 May 2021 13:06:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237509AbhEUDbr (ORCPT + 99 others); Thu, 20 May 2021 23:31:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:59662 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236848AbhEUDbg (ORCPT ); Thu, 20 May 2021 23:31:36 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 0CA5CAB64; Fri, 21 May 2021 03:30:12 +0000 (UTC) Subject: Re: [PATCH v3] bcache: avoid oversized read request in cache missing code path To: Christoph Hellwig Cc: linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Kent Overstreet References: <20210518110009.11413-1-colyli@suse.de> From: Coly Li Message-ID: Date: Fri, 21 May 2021 11:30:08 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/20/21 4:05 PM, Christoph Hellwig wrote: > This fix is pretty gross. Adding pages to bios can fail for all kinds > of reasons, so the fix is to use bio_add_page and check its return > value, and if it needs another bio keep looping and chaining more bios. > OK, I will try this idea and avoid to access BIO_MAX_VECS directly. > And maybe capping the readahead to some sane upper bound still makes > sense, but it should never look at BIO_MAX_VECS for that. > Thanks for the hint. Coly Li