Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3281198pxk; Mon, 5 Oct 2020 06:04:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJPJ/1HH10KZz/X9NZwag1uK2O6KxE9wFovJxZGNFSln9BsKB4S+VXMqoWn2Hg9QUCWYgJ X-Received: by 2002:a50:8881:: with SMTP id d1mr17133484edd.306.1601903088239; Mon, 05 Oct 2020 06:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601903088; cv=none; d=google.com; s=arc-20160816; b=gjkLBQsGCdR/5CiQBnW99BK8RsJTBciw1dyN1P6ZKW8OBdwZMpJz+C6EAkoFu2QdEA aUopG8Uoz9Zho6+YPnVN6b8pp2xsyC2xLoRWJnx75/v1rolsyDj7JSNmbqKBoTvb9mOr fowW6vynvpxE3d8EnSmHXoTBQdx/86ApGTgf2v9Z0EQifXqo8uwLi7zySt6CMeeHVTsc 14xzvuMYjPPJ7eRb8kWm6ViwLOMq1rub95ARcioOut8+rKZqChlhZaKxOSmgGmEXGaCF Hi7kPhLi2wwC2hqQp0YKQSZKGiQwio6Jt0QBc7dYdPs17RRKYOKkdyfD5CXOOvJftbKz bUxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=x7QPPNUTCaSWIZPB/ju4HImGo/gOqjVPUMvGsrjSBRM=; b=Ev5oWWycfgU62TxAAscWZkXRPS3iPo3OwK01kmU12EoKKpe0fL3SwnnQGbDn0Ck2bm KcKN0nTcHGErRjfFixfUkb2ev3i1dls7tLIIvo+5JYB+0ch4aMvNtjVTp4suNcqn/XqX HvSrvwGZuiQord2fGKWo6JvaGWNyadj4hZZdXFkEiddeHyZ9vZcuxALhGxFUVn1wR3GQ rNr8sN6YDw2eKoqe10HXpuMrChd5arNETrl3nzTxfsr4h/N7eCSkdTmV8/9yElHJ+Ncz UQakSAf6QKHPKI2MjR3PzvGrvQTAA8jDpmsU2Aod7AL7pRyeg2LLe207FiEz+xlTSXEu ZGmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cfNcbX1c; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w26si7216247edq.89.2020.10.05.06.04.25; Mon, 05 Oct 2020 06:04:48 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cfNcbX1c; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726138AbgJENAB (ORCPT + 99 others); Mon, 5 Oct 2020 09:00:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20947 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725891AbgJENAA (ORCPT ); Mon, 5 Oct 2020 09:00:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601902799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=x7QPPNUTCaSWIZPB/ju4HImGo/gOqjVPUMvGsrjSBRM=; b=cfNcbX1chkxu2m+ZXGja7C/hqZYqJ6Of98tjJvRc7+EGuzxA0R3J03Albjkv0L2DB8fGCu AM7Xpzcq/ZYwhKJWjd2+13cKXjGdp6oqRUZ+OKg0j0LxSDaOdcqi+fy6SUaEvkAStXpQVo PpBY08b1WOfI2x+etRjTgTIOtOIKJgM= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-61-ld2Mgjp4MsG1mSYjxeU3AA-1; Mon, 05 Oct 2020 08:59:58 -0400 X-MC-Unique: ld2Mgjp4MsG1mSYjxeU3AA-1 Received: by mail-wm1-f71.google.com with SMTP id 73so1683775wma.5 for ; Mon, 05 Oct 2020 05:59:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x7QPPNUTCaSWIZPB/ju4HImGo/gOqjVPUMvGsrjSBRM=; b=M5iHMkQX8d/VEeQSg3eiaYiLOOkVSHwRFGL7ED9qp99QQ3/oVnm2f5ThYVHoGP3EVq VBCk2muL6+DfIlf7kMtS6ZyCXvAMCE0ZJioy0/e0E4/eNuhEzWjmZb8k51Vo+2QHQPC3 aWSr1Ezn84T/Gqq++BgiR55M8Je3vokBgYJnuymTpk8e1l91CeMhNm9hetTWIy94bdoP Ky4VWbPkPeiH/y46oP4jZJvtwCWCj95ixtMW59Lb4I2eA0xnrjuKX23OJRRB0Pf3+UWQ XaRiYMvuLNwRA88D6y4ONfaWidFFccKM6BFz6AVsj2FPosQHa9csuIQlCNjBXznXyYsq GrGQ== X-Gm-Message-State: AOAM532M/6jniu6pIWyK5X+7gRJMPQmZU3dKp4w4kQBl6TEgyQZGIND0 coPv/JtkXa886rENGLwfJR0kIjc7OgGPEtUi4yfoJXSS5fhxba3W59FrDb/EA8iXZavqaMX/BGq Bo5JOIBrM4Une0vfd91N/WE2GYk47SwnS9xzGr/VX X-Received: by 2002:a1c:b40b:: with SMTP id d11mr11275484wmf.152.1601902795887; Mon, 05 Oct 2020 05:59:55 -0700 (PDT) X-Received: by 2002:a1c:b40b:: with SMTP id d11mr11275462wmf.152.1601902795672; Mon, 05 Oct 2020 05:59:55 -0700 (PDT) MIME-Version: 1.0 References: <20201003063143.13093-1-foxhlchen@gmail.com> In-Reply-To: <20201003063143.13093-1-foxhlchen@gmail.com> From: Andreas Gruenbacher Date: Mon, 5 Oct 2020 14:59:44 +0200 Message-ID: Subject: Re: [PATCH] gfs2: gfs2_read_sb: put gfs2_assert inside the loop To: Fox Chen Cc: Bob Peterson , cluster-devel , LKML , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Fox Chen, On Sat, Oct 3, 2020 at 8:33 AM Fox Chen wrote: > Before this patch, gfs2_assert is put outside of the loop of > sdp->sd_heightsize[x] calculation. When something goes wrong, > x exceeds the size of GFS2_MAX_META_HEIGHT, it may already crash inside > the loop when > > sdp->sd_heightsize[x] = space > > tries to reach the out-of-bound > location, gfs2_assert won't help here. that's true, but the smallest possible block size is 1024 bytes, and with that, the height cannot grow bigger than 10. So the assert is basically there only for documentation purposes. Thanks, Andreas