]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Fix misleading comment I added for commit 382a5c4e7ec08ec9291453ffad9541ab3...
authorJeremy Allison <jra@samba.org>
Sat, 21 Nov 2020 23:55:08 +0000 (15:55 -0800)
committerJeremy Allison <jra@samba.org>
Sun, 22 Nov 2020 01:22:36 +0000 (01:22 +0000)
smbd: Fix failure to check dstdir for delete on close

We're preventing ourselves from holding two locks here,
not protecting from waiting for a lock someone else
holds.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Nov 22 01:22:36 UTC 2020 on sn-devel-184

source3/smbd/open.c

index 11ddfc6eb0911fdc01830947273a8fe12e721288..3f5bc89cefee494a469461ca3924382812a214c0 100644 (file)
@@ -375,8 +375,10 @@ NTSTATUS check_parent_access(struct connection_struct *conn,
 
        /*
         * Don't take a lock here. We just need a snapshot
-        * of the current state of delete on close and someone
-        * else may already have a lock on this id.
+        * of the current state of delete on close and this is
+        * called in a codepath where we may already have a lock
+        * (and we explicitly can't hold 2 locks at the same time
+        * as that may deadlock).
         */
        lck = fetch_share_mode_unlocked(frame, id);
        if (lck == NULL) {