From owner-cvs-src@FreeBSD.ORG Tue Feb 26 03:03:18 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2676716A407; Tue, 26 Feb 2008 03:03:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 13D4D13C474; Tue, 26 Feb 2008 03:03:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m1Q33H2S082723; Tue, 26 Feb 2008 03:03:17 GMT (envelope-from delphij@repoman.freebsd.org) Received: (from delphij@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1Q33HTJ082722; Tue, 26 Feb 2008 03:03:17 GMT (envelope-from delphij) Message-Id: <200802260303.m1Q33HTJ082722@repoman.freebsd.org> From: Xin LI Date: Tue, 26 Feb 2008 03:03:17 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sbin/fsck_ffs setup.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2008 03:03:18 -0000 delphij 2008-02-26 03:03:17 UTC FreeBSD src repository Modified files: sbin/fsck_ffs setup.c Log: Be more careful when checking superblock. We have already checked whether fs_bsize is larger than MINBSIZE, which is larger than the value that is used to compared with fs_bsize, the sizeof fs, so the check followed, will be always true. By inspecting the code and some old commit log, I believe that the check must be that *fs_sbsize* is larger than sizeof fs. We round up the size to nearest dev_bsize, as the smallest accepted fs_sbsize, personally, I think this can be even changed to equal, because this number is mostly an invariant in file systems. With this check, fsck_ffs(8) will be more picky and has better chance rejecting bad first superblock rather than referring to bad value it supplied, thus gives better chance for it to check the filesystem carefully. Revision Changes Path 1.51 +1 -1 src/sbin/fsck_ffs/setup.c