Source-Changes-HG archive

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

[src/trunk]: src/tests/fs/puffs/h_dtfs Check that nobody raced us into the so...



details:   https://anonhg.NetBSD.org/src/rev/66c03e8e4abd
branches:  trunk
changeset: 756370:66c03e8e4abd
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Jul 14 21:24:40 2010 +0000

description:
Check that nobody raced us into the source dir while it was unlocked
in preparation for rename.

diffstat:

 tests/fs/puffs/h_dtfs/dtfs_vnops.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r 4738ae5fce10 -r 66c03e8e4abd tests/fs/puffs/h_dtfs/dtfs_vnops.c
--- a/tests/fs/puffs/h_dtfs/dtfs_vnops.c        Wed Jul 14 20:45:48 2010 +0000
+++ b/tests/fs/puffs/h_dtfs/dtfs_vnops.c        Wed Jul 14 21:24:40 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dtfs_vnops.c,v 1.5 2010/07/14 17:10:14 pooka Exp $     */
+/*     $NetBSD: dtfs_vnops.c,v 1.6 2010/07/14 21:24:40 pooka Exp $     */
 
 /*
  * Copyright (c) 2006  Antti Kantee.  All Rights Reserved.
@@ -326,6 +326,11 @@
        dfd_src = dtfs_dirgetbyname(DTFS_PTOF(pn_sdir),
            pcn_src->pcn_name, pcn_src->pcn_namelen);
 
+       /* does it still exist, or did someone race us here? */
+       if (dfd_src == NULL) {
+               return ENOENT;
+       }
+
        /* if there's a target file, nuke it for atomic replacement */
        if (pn_tfile) {
                if (pn_tfile->pn_va.va_type == VDIR) {



Home | Main Index | Thread Index | Old Index