Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/udf Running with DEBUG again revealed locking errors ...



details:   https://anonhg.NetBSD.org/src/rev/b39e8f92df40
branches:  trunk
changeset: 759976:b39e8f92df40
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Wed Dec 22 12:38:42 2010 +0000

description:
Running with DEBUG again revealed locking errors previously undetected. The
VAT writeout was done locked while marked locked as were the readin and
writeout of the metadata partition space table.

While here, also protect the (vp) argument of the UDF_SET_SYSTEMFILE() macro.

Tested on UDF 1.50 sequential, UDF 2.01 RW and UDF 2.50 metadata RW meda.

diffstat:

 sys/fs/udf/udf_subr.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (56 lines):

diff -r dad00f7ada06 -r b39e8f92df40 sys/fs/udf/udf_subr.c
--- a/sys/fs/udf/udf_subr.c     Wed Dec 22 12:15:02 2010 +0000
+++ b/sys/fs/udf/udf_subr.c     Wed Dec 22 12:38:42 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_subr.c,v 1.108 2010/09/24 22:51:50 rmind Exp $ */
+/* $NetBSD: udf_subr.c,v 1.109 2010/12/22 12:38:42 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.108 2010/09/24 22:51:50 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.109 2010/12/22 12:38:42 reinoud Exp $");
 #endif /* not lint */
 
 
@@ -73,8 +73,8 @@
 #define UDF_SET_SYSTEMFILE(vp) \
        /* XXXAD Is the vnode locked? */        \
        (vp)->v_vflag |= VV_SYSTEM;             \
-       vref(vp);                       \
-       vput(vp);                       \
+       vref((vp));                     \
+       vput((vp));                     \
 
 extern int syncer_maxdelay;     /* maximum delay time */
 extern int (**udf_vnodeop_p)(void *);
@@ -1738,7 +1738,7 @@
                        dscr,
                        inflen, 0,
                        UIO_SYSSPACE,
-                       IO_SYNC | IO_NODELOCKED | IO_ALTSEMANTICS, FSCRED,
+                       IO_SYNC | IO_ALTSEMANTICS, FSCRED,
                        NULL, NULL);
        if (error) {
                DPRINTF(VOLUMES, ("Error reading metadata space bitmap\n"));
@@ -1810,7 +1810,7 @@
                        dscr,
                        new_inflen, 0,
                        UIO_SYSSPACE,
-                       IO_NODELOCKED | IO_ALTSEMANTICS, FSCRED,
+                       IO_ALTSEMANTICS, FSCRED,
                        NULL, NULL);
 
        bitmap_node->i_flags |= IN_MODIFIED;
@@ -2815,7 +2815,7 @@
        vat_length = ump->vat_table_len;
        error = vn_rdwr(UIO_WRITE, vat_node->vnode,
                ump->vat_table, ump->vat_table_len, 0,
-               UIO_SYSSPACE, IO_NODELOCKED, FSCRED, NULL, NULL);
+               UIO_SYSSPACE, 0, FSCRED, NULL, NULL);
        if (error) {
                printf("udf_writeout_vat: failed to write out VAT contents\n");
                goto out;



Home | Main Index | Thread Index | Old Index