From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFDEAC433EF for ; Wed, 30 Mar 2022 15:42:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348342AbiC3PoE (ORCPT ); Wed, 30 Mar 2022 11:44:04 -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 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?