PERFORCE change 182652 for review
Zheng Liu
lz at FreeBSD.org
Fri Aug 20 12:56:47 UTC 2010
http://p4web.freebsd.org/@@182652?ac=10
Change 182652 by lz at 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
More information about the p4-projects
mailing list