Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Make whiteouts work on journaling ffs file system by adding ...



details:   https://anonhg.NetBSD.org/src/rev/5c1e89e79eda
branches:  trunk
changeset: 767918:5c1e89e79eda
user:      hannken <hannken%NetBSD.org@localhost>
date:      Wed Aug 03 10:03:51 2011 +0000

description:
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)

diffstat:

 sys/ufs/ufs/ufs_vnops.c |  11 +++++++++--
 tests/fs/vfs/t_union.c  |   6 +-----
 2 files changed, 10 insertions(+), 7 deletions(-)

diffs (67 lines):

diff -r 8d57aa61ab31 -r 5c1e89e79eda sys/ufs/ufs/ufs_vnops.c
--- a/sys/ufs/ufs/ufs_vnops.c   Wed Aug 03 09:48:12 2011 +0000
+++ b/sys/ufs/ufs/ufs_vnops.c   Wed Aug 03 10:03:51 2011 +0000
@@ -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);
 }
diff -r 8d57aa61ab31 -r 5c1e89e79eda tests/fs/vfs/t_union.c
--- a/tests/fs/vfs/t_union.c    Wed Aug 03 09:48:12 2011 +0000
+++ b/tests/fs/vfs/t_union.c    Wed Aug 03 10:03:51 2011 +0000
@@ -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();
 



Home | Main Index | Thread Index | Old Index