Module Name: src
Committed By: hannken
Date: Wed Aug 3 10:03:52 UTC 2011
Modified Files:
src/sys/ufs/ufs: ufs_vnops.c
src/tests/fs/vfs: t_union.c
Log Message:
Make whiteouts work on journaling ffs file system by adding the missing
UFS_WAPBL_BEGIN() / UFS_WAPBL_END() around CREATE and DELETE ops.
Fixes PR #44377 (union whiteouts don't work on ffs -o log)
To generate a diff of this commit:
cvs rdiff -u -r1.201 -r1.202 src/sys/ufs/ufs/ufs_vnops.c
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/vfs/t_union.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/ufs/ufs_vnops.c
diff -u src/sys/ufs/ufs/ufs_vnops.c:1.201 src/sys/ufs/ufs/ufs_vnops.c:1.202
--- src/sys/ufs/ufs/ufs_vnops.c:1.201 Fri Jul 29 22:18:56 2011
+++ src/sys/ufs/ufs/ufs_vnops.c Wed Aug 3 10:03:51 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_vnops.c,v 1.201 2011/07/29 22:18:56 riastradh Exp $ */
+/* $NetBSD: ufs_vnops.c,v 1.202 2011/08/03 10:03:51 hannken Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.201 2011/07/29 22:18:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.202 2011/08/03 10:03:51 hannken Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -912,6 +912,9 @@
case CREATE:
/* create a new directory whiteout */
fstrans_start(dvp->v_mount, FSTRANS_SHARED);
+ error = UFS_WAPBL_BEGIN(dvp->v_mount);
+ if (error)
+ break;
#ifdef DIAGNOSTIC
if (ump->um_maxsymlinklen <= 0)
panic("ufs_whiteout: old format filesystem");
@@ -931,6 +934,9 @@
case DELETE:
/* remove an existing directory whiteout */
fstrans_start(dvp->v_mount, FSTRANS_SHARED);
+ error = UFS_WAPBL_BEGIN(dvp->v_mount);
+ if (error)
+ break;
#ifdef DIAGNOSTIC
if (ump->um_maxsymlinklen <= 0)
panic("ufs_whiteout: old format filesystem");
@@ -943,6 +949,7 @@
panic("ufs_whiteout: unknown op");
/* NOTREACHED */
}
+ UFS_WAPBL_END(dvp->v_mount);
fstrans_done(dvp->v_mount);
return (error);
}
Index: src/tests/fs/vfs/t_union.c
diff -u src/tests/fs/vfs/t_union.c:1.5 src/tests/fs/vfs/t_union.c:1.6
--- src/tests/fs/vfs/t_union.c:1.5 Thu Jan 13 11:00:19 2011
+++ src/tests/fs/vfs/t_union.c Wed Aug 3 10:03:51 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_union.c,v 1.5 2011/01/13 11:00:19 pooka Exp $ */
+/* $NetBSD: t_union.c,v 1.6 2011/08/03 10:03:51 hannken Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@@ -133,11 +133,7 @@
/* check that we can whiteout stuff in the upper layer */
FSTEST_ENTER();
- if (FSTYPE_FFSLOG(tc)) {
- atf_tc_expect_signal(SIGABRT, "PR kern/44377");
- }
RL(rump_sys_unlink(TFILE));
- atf_tc_expect_pass();
ATF_REQUIRE_ERRNO(ENOENT, rump_sys_stat(TFILE, &sb) == -1);
FSTEST_EXIT();