From: Jeremy Allison Date: Sat, 21 Nov 2020 23:55:08 +0000 (-0800) Subject: s3: smbd: Fix misleading comment I added for commit 382a5c4e7ec08ec9291453ffad9541ab3... X-Git-Tag: samba-4.14.0rc1~572 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=53c39a261973f5e0ea1944c82ec14812187ed03f;p=thirdparty%2Fsamba.git s3: smbd: Fix misleading comment I added for commit 382a5c4e7ec08ec9291453ffad9541ab36aca274 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 Reviewed-by: Volker Lendecke Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Sun Nov 22 01:22:36 UTC 2020 on sn-devel-184 --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 11ddfc6eb09..3f5bc89cefe 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -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) {