summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-02-14 19:52:50 +0000
committerpfg <pfg@FreeBSD.org>2016-02-14 19:52:50 +0000
commit1960ec586d7230cc0c30e66f38cf083407036d2a (patch)
tree3df12faa11b14f165244229ea1d15a7a660c9e36 /sys/fs
parent55186e1731f56436d55b4d7cae78ced2b6d80782 (diff)
downloadFreeBSD-src-1960ec586d7230cc0c30e66f38cf083407036d2a.zip
FreeBSD-src-1960ec586d7230cc0c30e66f38cf083407036d2a.tar.gz
ext2fs: Remove panics for rename() race conditions.
Sync with r84642 from UFS: The panics are inappropriate because the IN_RENAME flag only fixes a few of the huge number of race conditions that can result in the source path becoming invalid even prior to the VOP_RENAME() call. Found accidentally while checking an issue from PVS Static Analysis. MFC after: 3 days
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/ext2fs/ext2_vnops.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c
index bc239b8..42e11c7 100644
--- a/sys/fs/ext2fs/ext2_vnops.c
+++ b/sys/fs/ext2fs/ext2_vnops.c
@@ -985,10 +985,10 @@ abortit:
dp = VTOI(fdvp);
} else {
/*
- * From name has disappeared.
+ * From name has disappeared. IN_RENAME is not sufficient
+ * to protect against directory races due to timing windows,
+ * so we can't panic here.
*/
- if (doingdirectory)
- panic("ext2_rename: lost dir entry");
vrele(ap->a_fvp);
return (0);
}
@@ -1003,8 +1003,11 @@ abortit:
* rename.
*/
if (xp != ip) {
- if (doingdirectory)
- panic("ext2_rename: lost dir entry");
+ /*
+ * From name resolves to a different inode. IN_RENAME is
+ * not sufficient protection against timing window races
+ * so we can't panic here.
+ */
} else {
/*
* If the source is a directory with a
OpenPOWER on IntegriCloud