mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Avoid panics from recursive rename operations. Not a perfect patch but
good enough for now. PR: kern/159418 Submitted by: Gleb Kurtsou Reviewed by: kib MFC after: 1 month
This commit is contained in:
parent
2013459487
commit
6e92aee4e2
1 changed files with 3 additions and 6 deletions
|
|
@ -965,11 +965,8 @@ tmpfs_rename(struct vop_rename_args *v)
|
|||
|
||||
/* If we need to move the directory between entries, lock the
|
||||
* source so that we can safely operate on it. */
|
||||
if (tdvp != fdvp) {
|
||||
error = vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY);
|
||||
if (error != 0)
|
||||
goto out;
|
||||
}
|
||||
if (fdvp != tdvp && fdvp != tvp)
|
||||
vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY);
|
||||
fdnode = VP_TO_TMPFS_DIR(fdvp);
|
||||
fnode = VP_TO_TMPFS_NODE(fvp);
|
||||
de = tmpfs_dir_lookup(fdnode, fnode, fcnp);
|
||||
|
|
@ -1143,7 +1140,7 @@ tmpfs_rename(struct vop_rename_args *v)
|
|||
error = 0;
|
||||
|
||||
out_locked:
|
||||
if (fdnode != tdnode)
|
||||
if (fdvp != tdvp && fdvp != tvp)
|
||||
VOP_UNLOCK(fdvp, 0);
|
||||
|
||||
out:
|
||||
|
|
|
|||
Loading…
Reference in a new issue