PERFORCE change 217672 for review

Zheng Liu lz at FreeBSD.org
Mon Sep 24 16:50:58 UTC 2012


http://p4web.freebsd.org/@@217672?ac=10

Change 217672 by lz at gnehzuil-desktop on 2012/09/24 16:50:54

	Fix a bug in ext2_append_entry because of incorrect the length of entry.
	Check whether we need to do an async IO or not.

Affected files ...

.. //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/ext2_htree.c#6 edit

Differences ...

==== //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/ext2_htree.c#6 (text+ko) ====

@@ -28,11 +28,17 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <sys/conf.h>
+#include <sys/namei.h>
+#include <sys/bio.h>
+#include <sys/buf.h>
+#include <sys/endian.h>
+#include <sys/mount.h>
 #include <sys/vnode.h>
-#include <sys/stat.h>
-#include <sys/buf.h>
-#include <sys/namei.h>
+#include <sys/malloc.h>
+#include <sys/dirent.h>
+#include <sys/sysctl.h>
+
+#include <ufs/ufs/dir.h>
 
 #include <fs/ext2fs/inode.h>
 #include <fs/ext2fs/ext2_mount.h>
@@ -448,7 +454,7 @@
 	last_entry->e2d_reclen = entry_len;
 	last_entry = (struct ext2fs_direct_2 *)((char *)last_entry + entry_len);
 	new_entry->e2d_reclen = block + blksize - (char *)last_entry;
-	memcpy(last_entry, new_entry, entry_len);
+	memcpy(last_entry, new_entry, EXT2_DIR_REC_LEN(new_entry->e2d_namlen));
 }
 
 /*
@@ -641,7 +647,12 @@
 	/*
 	 * Write directory block 0.
 	 */
-	error = bwrite(bp);
+	if (DOINGASYNC(vp)) {
+		bdwrite(bp);
+		error = 0;
+	} else {
+		error = bwrite(bp);
+	}
 	dp->i_flag |= IN_CHANGE | IN_UPDATE;
 	if (error)
 		goto out;


More information about the p4-projects mailing list