Module Name:    src
Committed By:   riastradh
Date:           Tue Jan 12 21:29:29 UTC 2016

Modified Files:
        src/sys/ufs/ext2fs: ext2fs_lookup.c

Log Message:
Use buffer cache, not page cache, to expand directories in ext2fs.

Candidate fix for PR kern/50607, PR port-evbmips/50059.

Formerly VOP_WRITE-->ext2fs_write would automatically dispatch to
this code path for writes to directories, but I broke that in
ext2fs_lookup.c rev. 1.78 when disentangling page-cached and
buffer-cached writes.

This was not a problem in ufs, and I didn't notice it in ext2fs,
because ufs consistently used buffercache(9) directly instead of
using VOP_WRITE sometimes as ext2fs did.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/ufs/ext2fs/ext2fs_lookup.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/ufs/ext2fs/ext2fs_lookup.c
diff -u src/sys/ufs/ext2fs/ext2fs_lookup.c:1.78 src/sys/ufs/ext2fs/ext2fs_lookup.c:1.79
--- src/sys/ufs/ext2fs/ext2fs_lookup.c:1.78	Fri Mar 27 17:27:56 2015
+++ src/sys/ufs/ext2fs/ext2fs_lookup.c	Tue Jan 12 21:29:29 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs_lookup.c,v 1.78 2015/03/27 17:27:56 riastradh Exp $	*/
+/*	$NetBSD: ext2fs_lookup.c,v 1.79 2016/01/12 21:29:29 riastradh Exp $	*/
 
 /*
  * Modified for NetBSD 1.2E
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_lookup.c,v 1.78 2015/03/27 17:27:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_lookup.c,v 1.79 2016/01/12 21:29:29 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -768,7 +768,7 @@ ext2fs_direnter(struct inode *ip, struct
 		auio.uio_iovcnt = 1;
 		auio.uio_rw = UIO_WRITE;
 		UIO_SETUP_SYSSPACE(&auio);
-		error = VOP_WRITE(dvp, &auio, IO_SYNC, cnp->cn_cred);
+		error = ext2fs_bufwr(dvp, &auio, IO_SYNC, cnp->cn_cred);
 		if (dirblksiz > dvp->v_mount->mnt_stat.f_bsize)
 			/* XXX should grow with balloc() */
 			panic("ext2fs_direnter: frag size");

Reply via email to