aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/uhsoctl
diff options
context:
space:
mode:
authorJason A. Harmening <jah@FreeBSD.org>2024-02-18 00:20:51 +0000
committerJason A. Harmening <jah@FreeBSD.org>2024-04-29 01:19:48 +0000
commit05e8ab627bc6fc6e607aea94b60fd264b8a6c736 (patch)
tree5d463740b324ddf888debd43761cb9182c679e76 /usr.sbin/uhsoctl
parent993d1fad5bd805dbd1820975e58839ff4276e7b0 (diff)
downloadsrc-05e8ab627bc6fc6e607aea94b60fd264b8a6c736.tar.gz
src-05e8ab627bc6fc6e607aea94b60fd264b8a6c736.zip
unionfs_rename: fix numerous locking issues
There are a few places in which unionfs_rename() accesses fvp's private data without holding the necessary lock/interlock. Moreover, the implementation completely fails to handle the case in which fdvp is not the same as tdvp; in this case it simply fails to lock fdvp at all. Finally, it locks fvp while potentially already holding tvp's lock, but makes no attempt to deal with possible LOR there. Fix this by optimistically using the vnode interlock to protect the short accesses to fdvp and fvp private data, sequentially. If a file copy or shadow directory creation is required to prepare the upper FS for the rename operation, the interlock must be dropped and fdvp/fvp locked as necessary. Additionally, use ERELOOKUP (as suggested by kib@) to simplify the locking logic and eliminate unionfs_relookup() calls for file-copy/ shadow-directory cases that require tdvp's lock to be dropped. Reviewed by: kib (earlier version), olce Tested by: pho Differential Revision: https://reviews.freebsd.org/D44788
Diffstat (limited to 'usr.sbin/uhsoctl')
0 files changed, 0 insertions, 0 deletions