Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp988763pxf; Thu, 25 Mar 2021 20:50:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/SPTP1m4aH933oE7iitIbBbHFkzH4Fsv1GnuTAxVQP1hagrMTaDY9fOvNGMK+Bmlxko92 X-Received: by 2002:a05:6402:1342:: with SMTP id y2mr12610021edw.285.1616730601961; Thu, 25 Mar 2021 20:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616730601; cv=none; d=google.com; s=arc-20160816; b=C0r1de7Cxd/60WS177l7BOYmJQjLfNi+DbqzPEV3WqXuVpSCZJT89g2y9Hx0BYTnU0 vV79/oCyOs5DUpjlZim+HZtLZR9KIzIaRplEQDmR+CajGJFj9VmtUDsy7imeWkbY9rke t3dALc6PZ8dPF3CWJW497kn/q25N12OlzNnD/LWYCclqa6A/uGvHxXvmciqxits/isEW Q8Cxn5bTDDWZB7I1eTcTyG3C8hXHxVWtlrxY/EGw+3G6jI7UqgFM70KzSuSQ5SRTOwpR R7mie7G4GsYnT28YDq9uHdVbqB3Y09fgGu2bS4musVgqtzGTtgNTtZ+/YmMIG6olxUvi hOUQ== 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=IvqEKjsOSXSVCaBU4hAjrkCMB1tDIaiTiUI6N7j8CrE=; b=TryOlLq1hF1reMjF+jhNvtAPy8+jC0cTbPCe5JXy8qUsCg5s28ZcCg0B9HvCYRxl9t FbNgQlP6ppJqw6CLXa8K5dOM984l7fEm1/i1k+rQ/wFzEHJvF6l+fwe8kKYIDbYUxNxi NgA8Oj8+Jd9Ig5r9Jt34e183Ign1DrRuDuHdLiDS6T6URUvRMAhbpbdTnJQi/XpIIjH5 lNCJFy8UZxXQnVfNpqMfm7B2yUozAN8UF1LwZ55UnahCsH//1l6Gd8F77uX/Uhr/svR6 8Pqbjp0K023pN5oj/n7OG9dGqcfm9swxtVJmP/Fm4qcnrScw/BcNedupIWKUOgq2kEAc UpFA== 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 z8si5419884edd.550.2021.03.25.20.49.39; Thu, 25 Mar 2021 20:50:01 -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 S230415AbhCZDsQ (ORCPT + 99 others); Thu, 25 Mar 2021 23:48:16 -0400 Received: from mail-pj1-f51.google.com ([209.85.216.51]:51028 "EHLO mail-pj1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230269AbhCZDrp (ORCPT ); Thu, 25 Mar 2021 23:47:45 -0400 Received: by mail-pj1-f51.google.com with SMTP id gb6so1957362pjb.0; Thu, 25 Mar 2021 20:47:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IvqEKjsOSXSVCaBU4hAjrkCMB1tDIaiTiUI6N7j8CrE=; b=ZIBgo8G7SGaNV745Y68pWQTUOAQJYwZP3ZMJJLnx2NbE+xAZdB5qfp6kB16BV55Kb+ O4hpKhXNmcVRQVLcj5uzQHxvC/J1XzksF/PsqB5uQydWu6z+Twxpu+QcQhqaBuG2v2nO +n35INQYYjnge8C67WHXyi50IIpJmGtzp2Y8E/AGMXYtdud2uLwBA1VxDn4RwJKTn//Q abGlWRID/wBoU5i0+jLMmkR8CBAACAnw3mtDKamhRZDCwJu46OJT9l3Yj+5LxRXS3pac YlwN+LuDa4zzFzlaovLRzQVOIlLhw05L3ZZPe0E9NduouJw0giw7BrG5tx9MICNGjHtg 5IKw== X-Gm-Message-State: AOAM530XuG1XxkziQ2tmfcZHrA12eK9jqWK3poCx0Vtuk49X45jaZ+dO sqO0i2z5tgp39vGbUyANzpM= X-Received: by 2002:a17:90a:ab91:: with SMTP id n17mr12179184pjq.4.1616730465440; Thu, 25 Mar 2021 20:47:45 -0700 (PDT) Received: from ?IPv6:2601:647:4000:d7:c5af:7b7c:edac:ee67? ([2601:647:4000:d7:c5af:7b7c:edac:ee67]) by smtp.gmail.com with ESMTPSA id t19sm7482900pfg.38.2021.03.25.20.47.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Mar 2021 20:47:44 -0700 (PDT) Subject: Re: [PATCH v2 8/8] block: add WARN() in bio_split() for sector alignment To: Satya Tangirala , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jens Axboe , Eric Biggers References: <20210325212609.492188-1-satyat@google.com> <20210325212609.492188-9-satyat@google.com> From: Bart Van Assche Message-ID: Date: Thu, 25 Mar 2021 20:47:43 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210325212609.492188-9-satyat@google.com> 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 3/25/21 2:26 PM, Satya Tangirala wrote: > @@ -1458,6 +1458,7 @@ struct bio *bio_split(struct bio *bio, int sectors, > > BUG_ON(sectors <= 0); > BUG_ON(sectors >= bio_sectors(bio)); > + WARN_ON(!IS_ALIGNED(sectors, bio_required_sector_alignment(bio))); Please change this WARN_ON() into WARN_ON_ONCE() to prevent a storm of call traces in the kernel log if this warning statement would be hit repeatedly. Thanks, Bart.