Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp13512pxb; Wed, 30 Mar 2022 21:26:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ+OMbMlxb8BehoQBcN+ddqZm0KFQ2DTXGZDHbSoHmp3whQHvEBssAGLXINX64Z6KsThQY X-Received: by 2002:a17:90a:2b86:b0:1c7:6e7a:3e00 with SMTP id u6-20020a17090a2b8600b001c76e7a3e00mr3808279pjd.115.1648700817882; Wed, 30 Mar 2022 21:26:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648700817; cv=none; d=google.com; s=arc-20160816; b=n/NMDmi0bgq3iIOWE08YeYik3gcDrt4Ip05lMQpzQ4e2Xw1QgEo/h05MFaNetMiU5M izvFiP2JUP5dYpVI5vvAz+zQXO/rWQZR3El/PTgHzi+A3lp4HPfloaTNE5RTp5PlYNbR BbSTaF3XuDoC1ppzVeqgqGzLTYiBX9jGTblgeP4JAOnEmx2Itg2gXTeiYyMqi8p9E8LO cAEOsc+VYdPiG8afq0N9+Ic+LP5mRsaPl5WaO2M7VbNHzop+Sai6H0ZVt5bMGyt18Tci fV7FfVtc5/tACbKAA7PSRVn2RMXfsx8/g9tlPxmxR1EHQmqTbZV5VRcS578GqHX8elmF LcJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mj2UbADx+YNRvo7oIcDQ5Z38Xm8WJ83fqDWbmjvlOwc=; b=ZR9uqU/JJ/Im+3xIQuysxfnPJEm1qmwnhcE+GCuqdBobykwis9OHCpzlEuzADMk2/m xvioSrFzkPXaXd+6SWS8z90/fztU4X6KuIbciOYdchKFXeMgrsXkoBdk7NSKL7cVTZIn NSNgxYU9VznV56DAV3MEN5MKTvOuERW32yGa+iBey7/RuAp3Qa0jByu8yu33j1A1ugA3 6ofApyKps+PMOqzqmdfw3lVvXwzbGt/VBthxr7lVqIlSO5GXCIPNdfUTNV6tEXfyRQCA JZHkm9Nw9B/GjpRaI61axFBZ20ATrJ5aILnNl+IPehCiPTQc9PO2yBSAVwsXtWc30fvf b7RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=LLGIXOeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s30-20020a63525e000000b003864fd7138fsi22702668pgl.871.2022.03.30.21.26.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 21:26:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=LLGIXOeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3EA379F6EC; Wed, 30 Mar 2022 20:22:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348337AbiC3PoD (ORCPT + 99 others); Wed, 30 Mar 2022 11:44:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239041AbiC3PoC (ORCPT ); Wed, 30 Mar 2022 11:44:02 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A40C033E0A for ; Wed, 30 Mar 2022 08:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mj2UbADx+YNRvo7oIcDQ5Z38Xm8WJ83fqDWbmjvlOwc=; b=LLGIXOeTCMzAUOivLAjaHxROvf kHk0MPMJ/17SNeJ/VV1+/HzYJuDE05PN7FyyRqwGn4zlvEnhH57Earji9YvrD9CBBJPAgJnauQ31y VIxGlDhrbdaLT1IO0F9ei6vMLUdoK1taK7RbKFVhg0csbcP3GpP/63bW1vYKJgFkS/0WvbEXBbAzS fYNVHpHpHBBQaVPUE9i0CUwgMYyAR35GKE0AgEi4a3ABY6BxI8n7HJiZkLtCqmrSx5VE1/QB25ilA APtj9UBd9761+s+wG3uf6Tg8sXcYaYwWt86EQpQKBd1RiELy+w/qPO9n1tI5FFLkhfUmFdU1XwrUx 1Oe+AhZg==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZaSf-00GbcO-2U; Wed, 30 Mar 2022 15:42:17 +0000 Date: Wed, 30 Mar 2022 08:42:17 -0700 From: Christoph Hellwig To: Liu Shixin Cc: Christoph Hellwig , linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] fs: sysv: check sbi->s_firstdatazone in complete_read_super Message-ID: References: <20220330104215.530223-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220330104215.530223-1-liushixin2@huawei.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 30, 2022 at 06:42:15PM +0800, Liu Shixin wrote: > sbi->s_firstinodezone is initialized to 2 and sbi->s_firstdatazone is read > from sbd. There's no guarantee that sbi->s_firstdatazone must bigger than > sbi->s_firstinodezone. If sbi->s_firstdatazone less than 2, the filesystem > can still be mounted unexpetly. At this point, sbi->s_ninodes flip to very > large value and this filesystem is broken. We can observe this by > executing 'df' command. When we execute, we will get an error message: > "sysv_count_free_inodes: unable to read inode table" This looks fine. Just curious: which variant of the sysv fs do you use and what is the use case?