From patchwork Mon Dec 10 06:48:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 1010280 X-Patchwork-Delegate: zajec5@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jpuvy1As"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OmAc2/54"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43Ctwd36vkz9s2P for ; Mon, 10 Dec 2018 17:49:36 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+VhU7KT/Ht7bxeP6CtSfXQAm0JjDH9aNH7Iif1qlzz0=; b=jpuvy1AsMifuJU QjL+f81dTW9b6INWoGCOwQ01Dn+nU1/SYQG3qwQaysYk+2ayqjAt3+em+AztVlACbCAhw2zQRSdf3 /TTKVF3oJT0jSwpUftasScbONeoNpKGuB2ATCnsCrcRf67mnJ/e0izr83s3R7dQqJpin9/yaLN4Xl w+kTxrlwaXhl8Trj1C3smE667OmVb3wpa57xfxMHXfaHifJrEC8I1Tsz6b5cPtrpqCdqr5JdwUeGH 0YVWOa9wz08iZUnvFumUCD4PIT92sx31XziZAn3ZKxSeQrQPint2SLibHRJXEGp3KfhLYIo7KxyhW 93X/mQNaQ9PQ/2wdKa1A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWFNZ-0005Ep-DS; Mon, 10 Dec 2018 06:49:21 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWFNW-0005Dx-NJ for openwrt-devel@lists.openwrt.org; Mon, 10 Dec 2018 06:49:20 +0000 Received: by mail-lf1-x144.google.com with SMTP id e26so7138302lfc.2 for ; Sun, 09 Dec 2018 22:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6bGOvzho1Rjy0eBxwI4xJoALEz36+P1MjmoqxLVPWoA=; b=OmAc2/54elQmek3WUbGgHmpUOFG3nhBL0EHOEI/hFBmRGc3BUqba1W/0G/fcEPMg+h tqVq7Tl2xDEEGdOnWPNCMpRfhn6aJa1Rg2Yc/jQMfTz+qP5cnXm/3L/oJWLmcCdeEI7X OnPiqUiPA9ChvmjajA+NCzkvkyygHxwd4U1xpS97IWEXQAQuo+mj6qSdp/FUJVN7zQsr qpAqzsHUrrB5rlOify5OiRMjd2USmm7CSLsFkdAqoDca+8HUeVdaCuOzNFrxPoiokzZV jJjZ2CTzYswLNUYedXinuxPYtz2bxO5K3yrw5kHjShegTDeiRx57l6ENt8kZan8JCHSN oRQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6bGOvzho1Rjy0eBxwI4xJoALEz36+P1MjmoqxLVPWoA=; b=FOvuxbE7EdDzUjlWAIZDK7x4BAhsk7jKhS9Ubx3ihEA1jSn2nWjOLoTH1wxQwdQGSl +/JmNYT3aPtDcLICTpRDpw/ivgXL+TpH+H+SAp9/eZu7oa65u2xhenTtL++jMggdvD9X CUhzimDrhpZpzkCiyqGgdSo20tWIpIVTiIjcagARWs6Y295/2wQ0s/mXq8Fp183qGXcy //i/d9zEJ9/gRCd9t/CGOldayOa73bIVjMXczGs9OuG38MvdRzcpQvYpZXkiVRgwG8A+ 49lXfAPH917tTt7EiOOHOYpjprIQL4lxOXqJcyh0jc9WNhRQ+MLehR9DB/VxNY5J8yUu u38w== X-Gm-Message-State: AA+aEWbp5nS6WZaIWXErt1asPL0ZOyJGOpBEIQOhL1B8S35c/nGyY9Cc 89KGWOHVJY5Zbck4N/ASh9IiE2oP X-Google-Smtp-Source: AFSGD/VXtIS27jEgjWKUrN7zrQjh/OIdL5YUY7LqRP8iCtdLqEmM8P1+pI362unPG3XelvcoPOqmHg== X-Received: by 2002:a19:5a05:: with SMTP id o5mr6512528lfb.140.1544424545950; Sun, 09 Dec 2018 22:49:05 -0800 (PST) Received: from linux-veee.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id s62sm1083116lfg.34.2018.12.09.22.49.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 09 Dec 2018 22:49:04 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: openwrt-devel@lists.openwrt.org Date: Mon, 10 Dec 2018 07:48:50 +0100 Message-Id: <20181210064850.7155-1-zajec5@gmail.com> X-Mailer: git-send-email 2.13.7 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181209_224918_787917_0A8F1B34 X-CRM114-Status: GOOD ( 10.29 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:144 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (zajec5[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zajec5[at]gmail.com) -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: [OpenWrt-Devel] [PATCH fstools] block: remove target directory after unmounting X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Rafał Miłecki This removes dangling directory fixing two issues: 1) Non autofs case Leaving directory in /mnt/ and switching to autofs would result in blockd failing to symlink(). 2) autofs case Leaving directory in /var/run/blockd/ could result in apps trying to access it causing errors like: blockd: kernel is requesting a mount -> sda1 blockd: failed to run block. add/sda1 Signed-off-by: Rafał Miłecki --- block.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index 091375f..f7fdc27 100644 --- a/block.c +++ b/block.c @@ -1130,11 +1130,13 @@ static int umount_device(char *path) hotplug_call_mount("remove", basename(path)); err = umount2(mp, MNT_DETACH); - if (err) + if (err) { ULOG_ERR("unmounting %s (%s) failed (%d) - %m\n", path, mp, errno); - else + } else { ULOG_INFO("unmounted %s (%s)\n", path, mp); + rmdir(mp); + } free(mp); return err;