From nobody Mon Dec 06 07:13:59 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2CAD618BDE81 for ; Mon, 6 Dec 2021 07:14:34 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J6vnP37n4z3sb7 for ; Mon, 6 Dec 2021 07:14:33 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: by mail-lj1-f175.google.com with SMTP id v15so19234702ljc.0 for ; Sun, 05 Dec 2021 23:14:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=kc/KK+n6V5CCguIyLLGQ9XYKE0x8TAe60XGl15oPjkM=; b=nNCpcC5u+wN4gjPiRmtpPkH2eNOclx1RqGU+l9pWsdWwYETvdhVSUKar8zJw4aRrCv MSf/LlowNy/jH+qDWbr51AC3FF7ygDLJfxpTFDYm+azzcTXjqp9H4Jsiu4zdymc5OVzx BcVuxtvEe1/z02rMtmZ6ButceO45gd83LZD+nAQHt2KbcCU/Dwb2Vuyn50UY3T+7/Yv8 +SmqwxgKuuoyp8mkxv4xie3S7fYNnXkouXLGpQPA5BRUBKKgwXSDiW0pcB0ISWkOJFQE 2EoTZsJOkfvGtlGQzkZdyhURuNozPapxGy1ZHvusSxW4KPCvP90AC/rP3LqQs5vp/hOg fkPg== X-Gm-Message-State: AOAM530TI1CCuu+uOUr0xW7IvPzhX5asrOaX0Heq5e+oNRNxh4EVY1vB 4+GSOt3nuJX/2VRIPYCzXnH7XP6t2ERp3A== X-Google-Smtp-Source: ABdhPJwiiDLzKOV+Ht87y/0gjGNwN0CkP3Tk93gEz8qWSiXhMWkpYsmIKXrZAVkT4QAQ2Js5ukK9YQ== X-Received: by 2002:a2e:b5d2:: with SMTP id g18mr34185595ljn.354.1638774865484; Sun, 05 Dec 2021 23:14:25 -0800 (PST) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com. [209.85.208.179]) by smtp.gmail.com with ESMTPSA id a7sm1273438lfi.149.2021.12.05.23.14.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Dec 2021 23:14:25 -0800 (PST) Received: by mail-lj1-f179.google.com with SMTP id m12so19114220ljj.6 for ; Sun, 05 Dec 2021 23:14:25 -0800 (PST) X-Received: by 2002:a2e:bc1c:: with SMTP id b28mr35080816ljf.500.1638774865088; Sun, 05 Dec 2021 23:14:25 -0800 (PST) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 From: Gleb Popov Date: Mon, 6 Dec 2021 10:13:59 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: nmount(2) returns undocumented EDEADLK To: freebsd-hackers Content-Type: multipart/alternative; boundary="000000000000b355c005d2750105" X-Rspamd-Queue-Id: 4J6vnP37n4z3sb7 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of 6yearold@gmail.com designates 209.85.208.175 as permitted sender) smtp.mailfrom=6yearold@gmail.com X-Spamd-Result: default: False [-0.99 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; NEURAL_SPAM_MEDIUM(1.00)[0.998]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.99)[-0.985]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.175:from,209.85.208.179:received]; FORGED_SENDER(0.30)[arrowd@freebsd.org,6yearold@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.175:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[arrowd@freebsd.org,6yearold@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DOM_EQ_FROM_DOM(0.00)[] X-ThisMailContainsUnwantedMimeParts: Y --000000000000b355c005d2750105 Content-Type: text/plain; charset="UTF-8" Hey hackers. I have a little program that calls the nmount(2) function in the following way: - First it mounts nullfs with fstype="nullfs", from="/src" and fspath="/dst". This works fine. - Next it tries to remount it as readonly by adding MNT_UPDATE and MNT_RDONLY to the nmount(2) call. This call fails with errno=11 (EDEADLK) for some reason. The relevant part of kdump: 19909 coolmount CALL nmount(0x801610380,0x6,0<>0) 19909 coolmount NAMI "/var/db/collaboraonline/child-roots/hQN4KQVIpWNA7Pic" 19909 coolmount NAMI "/var/db/collaboraonline/child-roots/hQN4KQVIpWNA7Pic" 19909 coolmount NAMI "/var/db/collaboraonline/systemplate" 19909 coolmount RET nmount -1 errno 11 Resource deadlock avoided Does anyone have an idea what's wrong with this? I can try coming up with minimal repro if needed. Thanks in advance. --000000000000b355c005d2750105--