From efd3fa3808499ede8c19ba3ede7bd67524538da1 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 9 Sep 2010 14:10:01 -0500 Subject: [PATCH] namei: Do not remove n_voldir1 When removing data directories in namei_RemoveDataDirectories, do not remove the n_voldir1 directory (directory X in /vicepa/AFSIDat/X). Removing this directory can race against the creation of an entirely unrelated volume, causing the create op to fail (since it tries to create a directory in a directory that no longer exists). We don't currently have the necessary locking to make this safe, and since the overhead of n_voldir1 existing is pretty negligible, just leave it there. Also add some comments briefly justifying this. Note that other similar races probably exist for directories under n_voldir1, but they would only be between volumes in the same VG, and so are much less likely to occur. (cherry picked from commit f2df207274c65b4fa8c24419150e9084a4d17fca) Reviewed-on: http://gerrit.openafs.org/2727 Tested-by: Andrew Deason Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear Change-Id: I2df4b73dd5125da0a2de52c3011ba167dc036a8b Reviewed-on: http://gerrit.openafs.org/3907 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/vol/namei_ops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c index ee86bd3dd..e039523a6 100644 --- a/src/vol/namei_ops.c +++ b/src/vol/namei_ops.c @@ -595,6 +595,7 @@ namei_RemoveDataDirectories(namei_t * name) int code = 0; char *path; int prefixlen = strlen(name->n_base), err = 0; + int vollen = strlen(name->n_voldir1); char pbuf[MAXPATHLEN]; path = pbuf; -- 2.39.5