Module Name: src
Committed By: pooka
Date: Wed Jul 14 21:24:40 UTC 2010
Modified Files:
src/tests/fs/puffs/h_dtfs: dtfs_vnops.c
Log Message:
Check that nobody raced us into the source dir while it was unlocked
in preparation for rename.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/puffs/h_dtfs/dtfs_vnops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/fs/puffs/h_dtfs/dtfs_vnops.c
diff -u src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.5 src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.6
--- src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.5 Wed Jul 14 17:10:14 2010
+++ src/tests/fs/puffs/h_dtfs/dtfs_vnops.c Wed Jul 14 21:24:40 2010
@@ -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) {