Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Aug 2010 12:56:46 GMT
From:      Zheng Liu <lz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 182652 for review
Message-ID:  <201008201256.o7KCukK5005917@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008201256.o7KCukK5005917>