From owner-p4-projects@FreeBSD.ORG Fri Aug 20 12:56:47 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CAA0810656A9; Fri, 20 Aug 2010 12:56:46 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D2B81065698 for ; Fri, 20 Aug 2010 12:56:46 +0000 (UTC) (envelope-from lz@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 60E7B8FC1C for ; Fri, 20 Aug 2010 12:56:46 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id o7KCukeQ005920 for ; Fri, 20 Aug 2010 12:56:46 GMT (envelope-from lz@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id o7KCukK5005917 for perforce@freebsd.org; Fri, 20 Aug 2010 12:56:46 GMT (envelope-from lz@FreeBSD.org) Date: Fri, 20 Aug 2010 12:56:46 GMT Message-Id: <201008201256.o7KCukK5005917@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to lz@FreeBSD.org using -f From: Zheng Liu To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 182652 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2010 12:56:47 -0000 http://p4web.freebsd.org/@@182652?ac=10 Change 182652 by lz@gnehzuil-freebsd on 2010/08/20 12:55:46 Fix a bug in mount ext2 file system. Affected files ... .. //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_vfsops.c#11 edit .. //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2fs.h#8 edit Differences ... ==== //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2_vfsops.c#11 (text+ko) ==== @@ -420,11 +420,8 @@ } if (E2FS_REV0_INODE_SIZE + fs->e2fs_want_extra_isize > - fs->e2fs_isize) { + fs->e2fs_isize) printf("EXT2-fs: no space for extra inode.\n"); - return (EIO); - } - return (0); } @@ -956,7 +953,7 @@ struct cdev *dev; struct thread *td; int error; - /*int i, used_blocks;*/ + int i, used_blocks; td = curthread; error = vfs_hash_get(mp, ino, flags, td, vpp, NULL, NULL); @@ -1036,16 +1033,15 @@ * NOTE: When ext4 file system use extents, we don't zero * block pointers. */ -#if 0 - if(S_ISDIR(ip->i_mode) || S_ISREG(ip->i_mode)) { - used_blocks = (ip->i_size+fs->e2fs_bsize-1) / fs->e2fs_bsize; - for(i = used_blocks; i < EXT2_NDIR_BLOCKS; i++) - ip->i_db[i] = 0; - } -#endif + if (!(fs->e2fs->e2fs_features_incompat & EXT4F_INCOMPAT_EXTENTS)) { + if (S_ISDIR(ip->i_mode) || S_ISREG(ip->i_mode)) { + used_blocks = (ip->i_size+fs->e2fs_bsize-1) / fs->e2fs_bsize; + for(i = used_blocks; i < EXT2_NDIR_BLOCKS; i++) + ip->i_db[i] = 0; + } + } - - ext2_print_inode(ip); + /*ext2_print_inode(ip);*/ bqrelse(bp); ==== //depot/projects/soc2010/ext4fs/src/sys/fs/ext2fs/ext2fs.h#8 (text+ko) ==== @@ -265,7 +265,8 @@ #define EXT4F_INCOMPAT_EXTENTS 0x0040 #define EXT4F_INCOMPAT_64BIT 0x0080 #define EXT4F_INCOMPAT_MMP 0x0100 -#define EXT4F_INCOMPAT_FLEX_BG 0X0200 +#define EXT4F_INCOMPAT_FLEX_BG 0x0200 +#define EXT4F_INCOMPAT_EAINODE 0x0400 /* * Features supported in this implementation